- Home /
Reusing Mesh
I have created a terrain (Made Up Of Meshes) Figure below .I am getting few issues :
Issue 1: Mesh Collider attached to the mesh appear to be not in right place as the ball stays/move above the terrain . Can't see why ?
Issue 2: When i am trying to reuse mesh i have created ,it's working actually but newly created mesh is not colliding with ball . Guess Colliders are not in right position again .
How can i see colliders position like i can see mesh using meshrenderer ?
Answer by arun.pandey89 · Mar 25, 2014 at 07:26 AM
Issue 2 is sloved :
All you need to do is nullify the mesh before assigning a new one. Weird but it did work :D
GetComponent().sharedMesh = null;
trying to catch what is wrong with issue 1.
Edit :
issue 1 is solved , problem was due to scaling of gameobject .
Wow nice one, this saved me heaps of time! Looks like the problem is that unity only recalculates the mesh collider if the instance has changed, so if you modify the mesh at runtime, the collider doesn't automatically update even if you assign it. Clearing the ref first fixes this. Thanks!
Your answer
Follow this Question
Related Questions
Questions about render distance in an open world game 0 Answers
Terrain import detail texture 0 Answers
Mesh Collider for Voxels 1 Answer
Car falls through terrain 2 Answers
Lighting Banding Artifact 0 Answers