- Home /
Generate only collision mesh
I'm away from home, so I can't test this out. What I want to do is generate a collision mesh, without having to generate the actual model mesh first.
Some background: I'm procedurally generating terrain, for an authoritative network app. The server needs to handle all player movement, thus the need for the collision mesh. The clients only need receive the terrain data and draw it.
The only way (off the top of my head) I can think of how to do this is, generate the mesh and collision mesh, then set the mesh to null. My concern is that this will remove the collision mesh also. Anyone have any insight into this?
Answer by efge · Mar 29, 2011 at 06:09 PM
You could create an empty GameObject (without any Renderer), add a MeshCollider and assign the collision mesh.
(like in this example: MeshCollider.sharedMesh)
I see, I didn't think about it that way. For some reason, I thought you actually had to assign the original mesh to the gameobject, then assign the collision mesh.
Ins$$anonymous$$d, I just create the raw mesh, and assign it to the collision mesh. Thanks!
Your answer
Follow this Question
Related Questions
Cant walk through doorway mesh created in Blender 1 Answer
Generated mesh collider on a generated mesh becomes a big box instead of taking mesh's shape 1 Answer
how can I instantiate an object specifically at the intersection of a collider and a mesh 1 Answer
MeshCollider Failure at high velocities 0 Answers
Correct position of overlapping meshes 0 Answers