I am making a game which involves a ball rolling around on the screen. The view is top down.
I would like the ball to speed up when it rolls down a "hill" and slow down when it rolls up a "hill." The hills ofcourse will just be different textures, as the view is top down so there is no height.
I have successfully done the down hill by using the OnCollision event and returning false, and multiplying the LinearVelocity by some factor every time OnCollision is fired (and it continues to fire as long as ball is on hill).
This does not work on the uphill though, instead of multiplying I divided. This eventually just makes the ball stop on the hill. I would like it to roll back down.
Any ideas how to accomplish this?