Hi, I started UE4 a bit over a month ago and have tried working on various things. For my current project I am trying to make a movement controller for a physics simulating actor. As it stands I’ve got it moving around and the camera controls and everything else working but I can’t solve one key issue.
I made the actor float a bit, if it hits the ground hard it’ll smash into it so it’s not a constant, but somewhat smooth. The problem is that this means it’s not always in contact with the ground and so can rotate to some odd angles. I have been trying to find a way to make it orient itself along its local X and Y axis of rotation to match the surface bellow it so that when I’m moving over a flat plane it will level out, and when moving over a slope it will angle to match the slope it’s over.
I’ve spent hoursl trying to use a line trace to what’s bellow it and trying to figure out how to convert the on hit normal into a usable rotator I could plug into an add local rotation node or something (preferably lerped to 0 by .95 or something so it’s a smooth transition over several ticks) but I haven’t been having any luck. I searched around a bit but coudn’t find any answers that worked properly on something that actively moves in 3 dimensions and not just one or two so I figured I’d just go ahead an ask. If anyone can help me out it would be greatly appreciated, and thanks in advance for your time, .