- Home /
How to prevent a sphere from jumping?
Hello community! I'm making a game with the sphere with attached rigidbody rolling over a curved surface. When it's velocity gets high enough, sphere starts jumping on the surface's curves. But i want it to go over curves smoothly, repeating geometry of the surface. I've tried to raycast down to surface and alter the sphere position based on raycast hit. But this leads to sphere always having non-zero velocity. I suppose it's because of the gravity pulling sphere down or the surface's mesh collider pushing the sphere out of it. It appears impossible to calculate exact position for a sphere with just a raycast. Since there's a game logic relaying on the speed of the sphere, a game becomes broken with raycast solution. Is there any way to stick a moving object to a surface or to correct my calculations?
Inaccuracies in real time physics engines can't be helped. Use other methods ins$$anonymous$$d (Like character controller)