I need some help with a system I'm scripting. I'm generating tiles out of two triangles, and and recalculating normals and bounds, and I'm updating the mesh used by the MeshCollider using the following code: Code (csharp): ... generate mesh ... mesh.RecalculateNormals(); mesh.RecalculateBounds(); MeshCollider col = GetComponent<MeshCollider>(); col.sharedMesh = mesh; However the player ( a CharacterCollider) will fall through the mesh if it is anything but perfectly flat, and even flat tiles cause physics problems. Any help would be greatly appreciated
Hi, welcome to the forum! The code you have posted looks basically OK. Can you post the code that generates the mesh? It would be worth checking out.