Sphere collider hopping on flat terrain


Any idea why this might be happening? The terrain is completely flat. A friend suggested that maybe the collider was detecting seams in the terrain mesh. The trail you see is the standard trailrenderer. The only thing my code does to affect the ball is to initially set the velocity in the z direction on a button press.

Any help is greatly appreciated!

Does the collider have “smooth sphere collisions” checked?

–Eric

Unless I’m missing something, Terrain Colliders don’t have the “Smooth Sphere collision” option. Mesh Colliders do, but if I replace the the terrain collider with a mesh collider, I don’t know how to set the mesh value in the mesh collider (since we don’t have access to the terrain mesh, as far as I know). So I guess the question count is up to 3:

  1. Why does the ball hop on a flat terrain collider?
  2. If I apply a mesh collider to a terrain, is there a way to set the Mesh value?
  3. If I replace or remove a terrain collider, is there a way to reapply it to the terrain? (i.e. there is no “terrain collider” under the Component->Physics menu)

Thanks so much for the help as always!

Bump.

I have this issue as well, and it never really was fully resolved–although, I never produced such a clear example.

This is a terrain specific bug, a similarly shaped mesh will not incur this error.

However, sometimes I can pass through a mesh collider, whereas on the terrain collider if this occurs, Unity compensates. My guess is what is happening is the object is ‘falling’ through the terrain, and the terrain engine is compensating by pushing it back up- resulting in the bump you see.

if that’s the case would increasing the physics timestep help any?

Likely, yes, it would. Unfortunately in my case, I’d need an impossibly short time-step to remove it entirely.

Really it would be nice if there were some built in way to damp that, or fix it. Everything I’ve thought of is too math heavy. Did you report this project to OTEE as a bug?

Also, is it rolling over a vertex when it hops?

I don’t think I reported it (don’t remember frankly =).

I don’t know how to test if the ball is hitting a seam in the terrain mesh (the built in terrain system, not our own mesh), since there is no way that I know to view the mesh. I was fooled at first when looking at the terrain- I thought I could tell where the seams were and then my buddy reminded me that I was only looking at the texture, and I don’t think there is any correlation between polygons and texture tiling.

Can I trouble anyone from the unity team to offer insight on how to avoid the dreaded bump?
Also, any insight into my other questions:

  1. Is the terrain mesh accessible in any way? (Code, Unity GUI, anything?)
  2. If I replace a terrain collider with another collider, is there a way to restore the terrain collider?

besuser, Does this happen with every fresh scene? The reason why I ask is that during beta testing of unity 2, something came up where the terrain mesh collider was not updating when the terrain was. I’m positive this was fixed during the beta, but maybe its an old terrain collider thats invisible?

Unlikely, but I thought I’d ask
AC

I have tested this on a number of new projects, however, I’m still @ unity 2.0, so if this is something fixed in the recent patches, that would be awesome!

Unity guys, any insight, in addition to my questions above?

Forgive me for being bothersome!

I don’t know if this is possible with a terrain, but have you tried adding/changing the physics material? Probably not a solution as much as a workaround if it fixes it…

i want to dig this post up again…ive got exatly the same problem with sphere collider on terrain (collider). The sphere is hoping around if the hmap resolution is higher then 65x65… the interesting part is, that the behaviour is changing if the car is driving horizontaly or vertically…

Did someone got a solution for this?

thanks