Physics 0.50 - Mesh Collider created at runtime is not working

Hello. I’m working on a procedural terrain mesh, using the Entities and Physics packages. I just updated those packages to the 0.50 version which caused the terrain colliders to stop interacting with the physics system. No collisions, no cast detections, nothing.

I’m not sure whether is correct to assume this is a bug. It’s possible that there is just some configuration I’m ignoring, but I can’t find anything about that in the docs.

So, is there a new way to create Mesh colliders at runtime or something else I’m ignoring about the new Entities / Physics packages that is affecting the colliders generation or simulation?

(This is the code I currently use to create the collider)

var colliderRef = MeshCollider.Create(verts, triangles, filter);
ECB.AddComponent(entityInQueryIndex, entity, new PhysicsCollider { Value = colliderRef });

Hi, i ran into a similar issue when upgrading. Adding a “PhysicsWorldIndex” component to the entity should fix it.
From what i understand, this is intended behaviour with 0.50. Not having a PhysicsWorldIndex on an entity is the equivalent of previously adding a PhysicsExclude component.

3 Likes

Thank you so much! it works now.

BTW, are you Orbis Terrain developer?