Fixed bug with night stand where you could spam the interact button to bug the animation playing

This commit is contained in:
2024-09-03 15:27:23 -05:00
parent 6a2e465004
commit faf00f1af0

View File

@ -1,13 +1,13 @@
extends StaticBody3D
extends Interactable
@export var promt_message:String = "press e"
@export var promt_key:String
var is_open = false
@onready var APlayer = $AnimationPlayer
func interact(player):
if not is_open:
$AnimationPlayer.play("Open")
if not is_open and not APlayer.is_playing():
APlayer.play("Open")
is_open = true
else:
$AnimationPlayer.play("Close")
elif not APlayer.is_playing():
APlayer.play("Close")
is_open = false