0 votes

Hi,
I'm creating a 2D platform game. I've been recently trying to check for collisions on raycast2D, and from some reason, it didn't collide with anything at all.

After a while, I've found that the reason is that they are children of a "Node" node.
After changing to Node2D it worked perfectly.

I was wondering if someone may be able to explain that phenomena.

Much appreciated.

in Engine by (77 points)

1 Answer

+1 vote

The "Node" node doesn't have 2D properties like position, rotation... so it doesn't work well with 2D nodes.

by (26 points)

Makes sense I guess.
Out of curiousity, would you mind elaborating a bit more about "doesn't work well"?

Why would raycast2D "care" about its parent when checking for collisions?
In terms of how the engine works.

Thanks for the answer!

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.