- Home /
Best way to achieve Sonic style physics?
So I'm making a 2.5D Sonic game where Sonic is just an invisible rigidbody ball with a Sonic model only being shown. The way he moves is perfect except for his behaviour on uneven terrain. What's the best way to make a rigidbody ball go faster downhill and slower uphill? I don't want to use any path system like splines, etc.
My current code logic which isn't really correct for all situations
if Sonic's rotation is not 0, i.e. not on flat ground
speed += speed * Absolute(rotation)
My code always adds force via the variable speed value. (It's multiplied by the raw horizontal axis when there's input).
I just want to achieve this with one check and statement without having to hard code anything. Thanks for your time.
Your answer
Follow this Question
Related Questions
Ball Doesn't Quite Roll Right 1 Answer
ball loses momentum 4 Answers
Strange sphere/physics rolling behaviour when scaled 1 Answer
Ball Doesn't Roll Down Hill - Physics Problem 3 Answers
How do I move my object through physics with my keyboard? 1 Answer