#Adding Mesh collider at runtiem.

1 messages · Page 1 of 1 (latest)

idle raptor
#

I am trying to add a mesh collider at runtime, but it is not working. In Inspector for PhysicsColider component is empty.
I have exported the mesh and created the entity using authoring and it is working correctly (left inspector).
One created from code has an empty physics collider inspector.
I am using MeshCollider.Create to create the collider. Then I am assigning it to PhysicsCollider component.
I am creating Material in my settings authoring from PhysicsMaterialTemplate. Do I have to do something else with that entity to make it work with physics? The entity is marked with the Static tag component.

idle raptor
#

Hmm, when I click on those entities with Inspector open, I get this error.
Something is not right with Collider.