Terrain Collider Bug in Unity 5


Terrain collider is not working right. Take a look at this;

Car will go through hill. Hill’s collider is at wrong place on terrain;

Car is at top of the hill collider at this image. So anyone got this issue?

Been having the same problem. Looks like the engine has trouble making mesh colliders for terrain after you change geometry. Probably has to be patched out.

Update: Seems to get fixed after you save your scene.

If your modifying terrain in playmode try this workaround,

float[,] terrainHeights=terrain.terrainData.GetHeights (0,0,terrain.terrainData.heightmapWidth, terrain.terrainData.heightmapHeight);
terrain.terrainData.SetHeights (0,0, terrainHeights);

Make sure this executes after the code that makes the modifications to the terrain.

Restarting Unity may fix the problem sometimes.

Fix this somebody who edit terrain in playmode ?

For anyone not editing in play mode and still having Terrain Collider issues that aren’t fixed with a save…

I don’t know if it’s a good solution, but I fixed this by baking a nav mesh into all my scenes. I then added a nav mesh agents to the player as well as all my enemy characters. It works better than nothing, but you have to re-bake if you change anything static in the scene, and baking can take a long time.

If there is a better fix in another thread please post a link in this thread.

I’m having this issue right now on 5.3.

The visual part of the terrain does not match up with the collider.

Our artist forgot to check out the collider while working on the terrain. About 16 hours worth of work. We can’t go back.

Is there a way to generate a new collider from the visual part?