godot-demo-projects/3d/platformer/coin/coin.gd

9 lines
178 B
GDScript3
Raw Normal View History

2017-07-15 23:33:49 +02:00
extends Area
var taken = false
func _on_coin_body_enter(body):
2020-02-20 01:09:55 +01:00
if not taken and body is preload("res://player/player.gd"):
2020-01-29 02:55:09 +01:00
get_node("Animation").play("take")
2017-07-15 23:33:49 +02:00
taken = true