27 lines
519 B
GDScript
27 lines
519 B
GDScript
extends MeshInstance3D
|
|
|
|
@export var anim_player : Node
|
|
@export var door_open_start : bool = false
|
|
var door_open : bool
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
door_open = door_open_start
|
|
|
|
if door_open:
|
|
open()
|
|
else:
|
|
close()
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|
|
func open():
|
|
door_open = true
|
|
anim_player.play("open")
|
|
|
|
func close():
|
|
door_open = false
|
|
anim_player.play("close")
|