0 votes

So I'm making my first game i Godot engine, and liking it so far. Everything worked, but then i added another "enemy" to the game, and since I have been unable to get it to work. I made a new scene for testing, and I can't figure out what is wrong.


2d view of testing scene:

The "error"/the collision:

So as you can see, it collides with... itself?
The collision position (350,450) is the position of the Parent Node:

Everything worked before, but I probably f*cked something up along the way. Any help is very much appreciated

in Engine by (35 points)

Your rays are not looking at the layer of the body, right?
(check layer on body properties and layer mask on rays, also type of body on rays if needed)

Thank you so much. Last time i tried using Layers and Mask it didn't work, but now it does. I've been pulling out hairs over this for hours, you saved my day :D

1 Answer

0 votes
Best answer

For now this is fixed, thanks to eons. I'm answering to close it, so other people can get their answers :)

by (35 points)

Layers and mask could be confusing, especially for the current namings of properties and methods but these may get reviewed on 3.

Basically a (collision) layer is where the object is detected and mask (or mask layer or layer mask or collision mask) is where it monitors for detections.

I know about mask and layer mask, but they Godot engine has it in a very... visual way? with the boxes next to each other and all.
That is just not what i was used to, as it has no hierarchy and more freedom, which I think is better, I just didn't get it.

But thanks for the explanation anyway and thank you for the help :)

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 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 webmaster@godotengine.org with your username.