#Physics Collider Baking inconsistency

1 messages · Page 1 of 1 (latest)

tired stump
#

What is the recommended approach to do something like a conveyor belt placement at runtime ?

A conveyor belt need to have an input & output sockets.
And the conveyor belt is basically a spline with a few system modifying the mesh at runtime.

How do you do a Physics Collider for each of the parts ? ( Belt, and one for each sockets ) Starting from a prefab with subprefab ( one for each component )
How to be sure that the sockets are not updating their collisions filters BEFORE the belt is placed ?

Again what would be the correct approach ?

My idea would be : ( cf screenshot ) purple : visual, green : a physic collider is present

Same question : how do you ensure a mesh collider is baked with an empty mesh ? ( I need to put a cube mesh for it to be present after conversion ) So I can update it at runtime ( if no mesh present it's currently not adding the physics Collider component )

Same thing about parenting loss at baking. in my screenshot If I don't add the Parent component at baking in a authoringMonobehaviour, the two socket lose parenting :/

hoary dust
#

Let me unpack this a little.

#

For starters, we currently don't support baking "empty" meshes. We simply don't create the rigid body if there is no collider present.

#

You can though manually create rigid bodies in code if that helps.

#

You could use a compound collider to represent your conveyer belt, e.g., using multiple boxes that you place and shape in accordance with your spline.

#

Or you can create a MeshCollider using the MeshCollider.Create() function and handing it input vertices and triangle indices.

#

If you want to do procedural conveyor belt creation based on a spline, I think procedurally creating the physics of the conveyor belt would be the best way to go here.

#

You could have a look at the ragdoll demo in the PhysicsSamples. The ragdolls including their graphics are created in code as entities. Maybe that could give you some code to work with as a starting point.