How to stop a ball when rolling on ground
I've seen this question asked several times over the years and have yet to find a good answer to the problem. The problem is that when I have a sphere with a Rigidbody, it just continually rolls forever on the slightest incline. I can get it to come to a stop on a completely flat surface, but if the ground is angled even 1°, it just keeps rolling.
I'm trying to make a golf game, so the ground will not be flat and I need the ball to roll quicker down hill and slower up hill, so I don't want to just apply a constant reduction in velocity. I also want it to slow down quicker on different types of terrain (green, fairway, rough, sand, etc). I've tried tweaking the drag and angular drag, but this only increases how quickly it slows down. It never fully comes to a stop.
I accept that I will probably have to apply some kind of force or alter the rigidbody in some way in my script, which is fine, I'm just not sure where to start.
Answer by ASlicedLake · Feb 15, 2021 at 11:07 AM
Have you tried editing the Physics materials? They have a coefficient of dynamic friction, and you can set it for both the ball and the ground. Play with different values to see what you like. You ought to be able to set different Physics materials for fairway, green, etc.
Your answer
Follow this Question
Related Questions
BallShooting Game Issue with Detecting ball stopping when rolling uphill 1 Answer
Aim ball with mouse, add force holding mouse down 0 Answers
Collision detection glitch 1 Answer
Is it possible to make Unity portable? 1 Answer
How to make physics for rail trolley with gravity changing. Unity 2d game 0 Answers