Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Zync |
i got 250 sprites under a Node…
how do i make it so when the player collides with the sprites/the node
he will die/respawn?
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Zync |
i got 250 sprites under a Node…
how do i make it so when the player collides with the sprites/the node
he will die/respawn?
Reply From: | sparkart |
Area2D has a “body_entered(body)” signal that you could use. You can also use the “name” property to filter for the player/object being collided:
func _on_body_entered(body) -> void:
if body.name == "player":
GLOBAL.player_dead()
GLOBAL.restart_scene()