How do I use a line trace to keep my object level while also adding force?

I have tried for a few days without getting the results I want so I’m hoping someone with more knowledge can help.

What I am trying to do is have something hover above the ground by using a line trace as a simple spring to add force to my object. This bit works as intended.

The issue is that I also want to level my object to the ground, for this I am using the impact normal of the line trace. And creating a rotation from this and the forward vector of my object. This should work in theory, but I think the spring and the “levelling” blueprints are fighting each other. Causing my object to lag and then shake as you can see from the following video.

[https://streamable.com/5aa2hg][1]

Here is my blueprint for levelling, I have also tried RInterp before setting rotation but that didn’t work either.

So, any advice would be most welcome, I have already trawled Reddit, youtube and UE4 Answers hub.

Thanks! I’m still not sure what I was doing wrong but I followed your blueprints and changed the SetLocation logic to an AddForce logic, with the force vector coming from the normal of the hit. With a bit of tweaking I think it will be exactly how I want it. Here’s an example: https://streamable.com/kmhnu5

The code looks ok, I’m wondering if it’s how you are tick / interp.

This cube monitors the distance and angle of the object underneath it:

Tick:

Height:

Angle:

Result:

310985-ezgifcom-optimize.gif

Looks great :slight_smile:

What sort of frame rate are you getting with all that grass? ( Looks lovely )