Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Godot: Star scene that sends a signal when colliding with a player object and then removes itself from the game
extends Area2D
signal star_taken
func _on_Area2D_body_entered( body ):
if (not body.get("is_player") == null):
$CollisionPolygon2D.disabled = true
hide()
emit_signal("star_taken")
queue_free()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.