Raycast - Bug or lesson learned? (DEF-2635)

Spend a full day figuring out why on earth my ray casting stopped working suddenly.
It seems like for ray_cast to actually throw a ray_cast_response the collision object must not only be grouped with the correct group but also it need to mask some other group.
Even if ray_cast isn’t a part of a physics group itself the collision object doesn’t seem to exist if it is not masked with any other group.
So now I’m masking my collision object with a group called “fake” which is a group with no members. Weird but it doesn’t seem to work otherwise. Guess it’s a Box2D thingie?

At least it could be worth mentioning in the documentations

/A

Yes, that does sound like a good idea :slight_smile: Is this how Box2D works or is this a limitation in Defold? @sicher and @Ragnar_Svensson, do you know?

From the description it absolutely sounds like a bug, either in our layer or Box2d. It needs to be investigated to tell. In any case, it seems like we should do a larger pass on physics very soon to fix all these different issues.

1 Like

Created DEF-2635

1 Like