I'm trying to get a ball to roll up or down a hill realistically.
With default settings for a sphere, if I apply force it rolls realistically, but will roll right up and over any hill, and basically roll on forever. Of course it should slow down when rolling on a flat surface.
The default angular drag was 0.05
If I increase this to 10, then it will roll and stop more realistically, but if it stops while rolling up a hill, it won't roll back down. It just sits on a hill.
If I crank up the gravity, the ball will roll down a hill a little faster, but won't accelerate.
From what I've read, mass doesn't affect gravity, it just affects collision with other objects? Is that true?
I've been trying to tweak these numbers, does anyone have some good numbers for just a simple 1 scale, 0.5 radius sphere to roll accurately?
I want a ball that will roll down a hill, and speed up faster and faster the longer/steeper the hill is, and slow to a stop on a flat surface.
asked Jun 01 '11 at 04:33 PM
Well I answered my own question in a way. Instead of just setting the velocity, I'm now using ApplyForce, and with that change I'm able to fiddle with gravity and drag to get what I want. Thanks for your help :)
answered Jun 01 '11 at 05:43 PM
It sounds like your constantly adding force. "Realistically" the ball only has force applied to it when you "kick it" the rest of the time it is reduced by air and contact friction. So if you have AddForce in your FixedUpdate, you would get an unrealistic result.
You need a One time shot to add force briefly then let it go its course. Look up AddExplosionForce in the documentation.
answered Jun 01 '11 at 04:40 PM
I do just add force once:
Ball.rigidbody.velocity = CameraForward.transform.forward * BallSpeed
Currently I'm using 25 for BallSpeed, with Angular Drag at 25 and the rest default, because in my opinion this looks the best, except it won't roll down hills.
answered Jun 01 '11 at 04:47 PM