Signal from Area2D makes player instantly dies on spawn.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By BuddyGames

Signal from Area2D is meant to only enable queue_clear when it’s in contact with body, but the player instantly dies on spawn.

Was following this YT tutorial by GD quest (time stamp 1:43:36). I have the exact syntax and followed the steps (to my knowledge) perfectly. Anyone able to take a crack at what’s up?

#Player script
func _on_EnemyDetector_body_entered(body):
the rest is just node stuff which I can provide pictures of if required.

Check enemy body collision shape. Does it have correct size?

AlexTheRegent | 2021-01-09 17:17

Yeah, the size is fine. Plus I have it spawned far enough away from the player. I’ve been experimenting with it all day, and i changed queue_free to jump, and intrestingly it seems to always activated the function when the game starts

BuddyGames | 2021-01-09 17:33

:bust_in_silhouette: Reply From: Thomas Karcher

Judging from your comments, there’s some other body (not the player) touching the Area2D. Seeing that there’s only one other body (the enemy) in the linked video, I’d assume there’s either a problem with the settings of your collision layers and/or collision masks in the “Enemy” or “StompDetector” node, or you added some other collision object not shown in the video.