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
|
var is_open = false
|
||||||
|
@onready var APlayer = $AnimationPlayer
|
||||||
|
|
||||||
|
|
||||||
func interact(player):
|
func interact(player):
|
||||||
if not is_open:
|
if not is_open and not APlayer.is_playing():
|
||||||
$AnimationPlayer.play("Open")
|
APlayer.play("Open")
|
||||||
is_open = true
|
is_open = true
|
||||||
else:
|
elif not APlayer.is_playing():
|
||||||
$AnimationPlayer.play("Close")
|
APlayer.play("Close")
|
||||||
is_open = false
|
is_open = false
|
||||||
Reference in New Issue
Block a user