[Question] 'Damping' Motion in Blueprint? [Soft Gravity-Repulsion For Hover Craft] Video + Screenshot

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:

Hi James,

You should be able to achieve the result you want by using a Physics Thruster component in your Blueprint.

As for why it moves when you begin play, you are probably somewhere updating the vehicle’s position to absolute 0,0,0 (the level origin).

Cheers

Hi Stephen, this almost works but the problem is the thrust ends up rotating the craft unless it’s in a perfectly central position, and the velocity is constant.

You will have to create the setup to meet your needs. For instance, if you are having problems stabilizing it, then it sounds like you need multiple thrusters spread out to distribute the mass.

As for the velocity being constant, you have full control over this in the Blueprint. I made a very simple Thruster test with an Actor Blueprint where it turns the thrust off and on based on collision with the ground. You may want to start with the same basic setup, and then build on it to meet your needs.

Happy developing!