The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

Hi,

I'm new to Godot and have been working on my first platform game.

After designating layers for collision, all my enemies are detecting player perfectly when Player is in contact with them, but for some reason at the start of the level, all the enemies detect Player immediately, even though Player is nowhere near any of them.

Is there anything I'm maybe missing or doing wrong?

Thanks guys!

Godot version 3.0
in Engine by (14 points)

Do you place the enemies at the origin when spawning them?

Thanks for the reply.

All enemies are placed at their own starting point, some further down in the level. If I add another enemy anywhere on the map, they would also detect the player at the beginning. This is affecting my player damage and the game is unable to run due to this, unless I put damage off

Is there any code for spawning or something that you could show me?

I uploaded the entire project to my Google Drive, please take a look if you can, I would really appreciate it. For some reason, new collisions are being detected as well but are not solid objects and anything else just passes right through.

Thanks for the reply :)

https://drive.google.com/drive/folders/1mz_pMEDzSZt2wzj_EVxgerUlvmlccLqC?usp=sharing

I put a simple print statement to print the name of the body that the goomba detects. It was TileMap. Which is really weird since the collision layers don't match up?

THANK YOU!! Your reply made me figure out exactly what the issue was. It seems I overlooked something small.

The collision box for my side_checker on the goomba was too low and was colliding with the tileset (Even though it shouldn't have as the layers weren't masked together). Anyway, I decreased the Y-axis under the transform tab for the CollisionShape2D to be above the tileset. That seemed to have sorted out that issue.

Thanks again for taking the time to help

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.