Raycast within the hull of a collision object?

Is this ever possible to be supported or never a possibility?

I want to use short raycasts to see if something is inside of a larger collision object, to detect the number of large objects overlapping a space.

Workaround I’m using is to use a factory to spawn small collision objects in the areas I want to detect which delete themselves on their updates. Is there a better way?

I’m guessing you mean if the ray starts within another collision object?

I definitely thinks it’s useful to get such a result from the callback. I see no reason why it shouldn’t be possible. We currently have no such task in our backlog though.

Yes, say a raycast of length of 4 fully within a collision object of 100x100. Would be useful.

There’s no better way that I can think of right now, and in all honesty, it is unlikely that we will improve this in the near future.

1 Like

It would still be useful to add it as an option to raycast inside.

I’m once again coming up against this when I want to drag fixtures around by mouse cursor. For now using solution of having a small physics collision object always be at cursor/touch x,y and tracking whatever it is currently first overlapping. But a raycast would be nicer because it can be customized on the fly more easily.

Also on mobile the collision object cursor option requires 1 frame delay I think which does make the game feel less responsive.

Strange thing that can happen with mouse cursor collision object. Making the mouse cursor collision object tiny like 0.01 diameter seems to solve it in some cases but not others.