12 lines
280 B
GDScript
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()
|