Page 1 of 1

F-Zero like gravity

Posted: Wed May 25, 2016 4:20 am
by Madness Of Madara
How do it get F-Zero gravity like in this video?

https://youtu.be/0Aetc_Vmjvg

Re: F-Zero like gravity

Posted: Thu May 26, 2016 11:23 am
by benelot
Hello Madness Of Madara,

This is a special kind of gravity as you might have realized. I would set the world gravity to zero and implement some kind of adhesive force to the tube you are moving on. This means that as long as you are near the tube (within a certain range), you get some force pulling you towards the center of it. If you drive on the inside of a curve, you get momentum that even pulls you onto it. But if you drive on the outside of the curve, the momentum pulls you off the tube, as it gets higher as the adhesive force. I am not sure if you need to reduce the friction or if by my idea you easily bump into the tube and fall off, but that would have to be tested. Else you might have to implement it in a non-physical way by tweaking the physics in many cases to behave correctly.

I do not remember exactly from the days I played F-zero: What are the cases you actually fall off?

Re: F-Zero like gravity

Posted: Fri May 27, 2016 8:02 am
by Madness Of Madara
I already know that, but this is not a sphere that has a fixed center of gravity. The gravity I need changes depending where on the tube the vehicle it on.

Re: F-Zero like gravity

Posted: Fri May 27, 2016 9:21 am
by benelot
Depending on what side it is on? Or what side on the curve? Is it not possible to pass slowly on the outside of the curve? Well, then you need to build a model of your curves and apply forces to your ship according to the position. Since F=m*a, you can easily describe your force in terms of gravity and then apply it to the ship via its weight. You can even create an applyGravity() method for thr ships.