GodotCourse/week6/original_project/scripts/coin.gd

10 lines
150 B
GDScript3
Raw Permalink Normal View History

2024-08-18 23:47:45 +00:00
extends Area2D
@onready var game = %GameManager
func _on_body_entered(body):
if body.is_in_group("player"):
game.coinCollected()
queue_free()