- Home /
Converting to ColliderCast - what's included in the PhysicsWorld and how do I include my own meshes?
I have a working raycast using Physics.Raycast, now I'd like to turn it into a collider cast to be used with the job system (I know those aren't direct analogues, the raycast is just to make sure my problem is with the different casting system and not that there really isn't anything to hit).
However, I can't really find much documentation.
I downloaded the ECS examples and had a look at the scripts associated with the CastTest scene under UnityPhysicsSamples > Assets > Demos > 3. Query
I managed to understand enough to get an example that runs with no errors, but the colliders I created collide with nothing
I set the filter's BelongsTo
and CollidesWith
to ~0u
(and GroupIndex
to 0), just for the sake of the test - I do want to limit what if can collide with.
My only guess is that the PhysicsWorld
does not include the 2 meshes I want the collider cast to collide with. The PhysicsWorld
object I pass (with ref
) claims to have 1 static body (and I assume NumBodies
, which also is 1, is the sum of static, dynamic, and possibly joints).
So my question is, what do I need to do to have my meshes included in the world, assuming that is indeed my problem?