GrappleTest/Objects/AnimTrigger/AnimTrigger.gd
2024-03-17 21:56:16 -05:00

12 lines
280 B
GDScript

extends Area2D
@export var animator : AnimationPlayer
@export var animation : String
@export var playOnce := true
var animReady = false
func _on_body_shape_entered(_body_rid, _body, _body_shape_index, _local_shape_index):
animator.play(animation)
if playOnce:
queue_free()