GrappleTest/Objects/AnimTrigger/AnimTrigger.gd

13 lines
280 B
GDScript3
Raw Normal View History

2024-03-13 16:15:55 -05:00
extends Area2D
@export var animator : AnimationPlayer
@export var animation : String
@export var playOnce := true
var animReady = false
2024-03-17 21:56:16 -05:00
func _on_body_shape_entered(_body_rid, _body, _body_shape_index, _local_shape_index):
2024-03-13 16:15:55 -05:00
animator.play(animation)
2024-03-17 21:56:16 -05:00
if playOnce:
queue_free()