I would like to set up an hovering vehicle to make a Wipeout like race game . The first time I used wheeled vehicle with invisible wheel, not so bad result but…
I tried to make a real hovering system with the UFO blueprint that is in the content example of UE4 . I copy blueprint and set the camera follow right, the ship turn good and other stuff… but the UFO that I use is a flyng Actor, it do not hover above the ground, and this is what I want to do .
It almost seems like you’d want some sort of spring constraint on your UFO. Basically, a spring with a length equal to the max height from the ground you want your ship to float, maybe with lowish damping so you can fly upward off of ramps and stuff.
No idea if UE4 can accommodate this method, but if it can, you basically just want a spring between your ship and the terrain, and update the position of the spring on the terrain every time the ship moves. Something like that.
I would add an action that runs every tick (yeah, you have to do something like that) that checks the distance between UFO and ground (using a trace of some sort) and adds an upwards force proportional to the inverse of the square of the distance between UFO and ground, and proportional to the downwards velocity of the UFO. This ends up being a kind of PID controller for the height of the UFO. Then, add a downwards force, such as gravity, and crank up the trace and down-velocity proportions to make it hover at the height you want.
Well Verlet integration is for cloth and things like this (rope, cable…) I don’t understand why using it could help in my case ??
I don’t even know ho to simply add gravity to my actor !
Mathematics don’t afraid me so much, but I don’t know how to tell UE4 :
“Please take this ground distance and add me an upward force man !”
I create a Spring Arms and I try to copy what Z-enzyme do, but we don’t start our project by the same way, he use 4 axis where I just have an actor Oo I wrote on him topic for a kind of tutorial because I’m sooo newbie .
You probably want to create your own Pawn class that runs the hover simulation, and your own Controller class that sends input to that Pawn
If you want the hover to conform to terrain (lean up when going uphill) you need either more traces, at the four corners of the hover, or do something smart with the normal of the hit you find with the one trace.