I’m trying to set a relatively stable (but springy) altitude for my hover-craft so that it remains at a fixed height above the ground. However, I also want this altitude to be fairly ‘springy’, so you can think of the air between the craft and the nearest collision below it as a suspension spring, but with no upper height limit.
What this means is that if the craft flew off of a cliff, it wouldn’t hit the ground directly, but would ‘sink’ and then slowly return to it’s stable altitude, which is only a short distance from the ground. Really, I want to do this ‘ground repulsion’ in a sphere around the craft, as if the craft is magnetically repulsed by the ground or terrain it’s driving into.
I am currently using this network of nodes to give the craft altitude, but it is very jerky in-game, and also has no form of damping so the movement is pretty harsh. I also don’t think I want to use a Line Trace to set the altitude, but maybe use a collision sphere or capsule instead? Anybody able to help with this? I also probably want to add some sort of self-righting spring too when the craft is at a low altitude to prevent the craft from rolling all over the place.
[Also in the video, the actor seems to move location when I simulate… any ideas why?]
VIDEO HERE: