Fixed bug with night stand where you could spam the interact button to bug the animation playing
This commit is contained in:
@ -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
|
||||
Reference in New Issue
Block a user