pandemonium_demo_projects/2d/physics_platformer/coin/coin.gd

9 lines
166 B
GDScript

class_name Coin
extends Area2D
var taken = false
func _on_body_enter(body):
if not taken and body is Player:
($AnimationPlayer as AnimationPlayer).play("taken")