Created
February 16, 2018 19:32
-
-
Save LarsBergqvist/dfd45ec5374e7468e66e8210e2b782c2 to your computer and use it in GitHub Desktop.
Godot: Star scene that sends a signal when colliding with a player object and then removes itself from the game
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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