15 lines
329 B
GDScript
15 lines
329 B
GDScript
class_name OpenActionable
|
|
extends Area3D
|
|
|
|
func action() -> void:
|
|
var parent_chest = get_parent() as Chest
|
|
if parent_chest == null:
|
|
push_error ("Cannot open chest. Parent is not a Chest!")
|
|
return
|
|
|
|
if parent_chest.is_open:
|
|
return
|
|
|
|
parent_chest.open()
|
|
InteractionSystem.start_chest_open_sequence(get_parent() as Chest)
|