Setting Pawn Rotation to Match the Floor

Hi there, so I’m working on setting up a hovering vehicle which is all working rather well so far. My issue is that the roll and pitch of my vehicle are locked by default I guess. What I need to do is set up the blueprint to allow the vehicle’s pitch and roll to adjust to the changing terrain. As far as sticking to surfaces upside-down, I’ll figure that out later. Thanks for your time!

Hi, you could try taking that rotation you have, converting to XVector, then getting the surface normal of the ground under the vehicle (do a trace down and get the hit normal), adding that vector to the actors XVector, then converting back from Xvector to Rotator and updating your vehicle rotation with that.

I may have missed a step and you may want to not use the whole strength of the underlying normal, or even do a time lag blend to it using some kind of moving average. I hope my idea works, if not let me know.

I did this before for a tank game I was tinkering with.

3 Likes

@ - Dude i cant thank you enough for that! helped me out so much :smiley:

thanks for this, I was using make rotate from z and it worked for going up hills but not when you started to go down them. I understand now why you have to put the right vector in.

> Thanks you ! It works very well !

awesome thanks for this!

Awesome . Thanks!

you rock Enos! thanks!

Where about does the “LineTraceForObjects” link up to on the left, and the “RInterp” near the end link up to, got no idea where to put them

Thank you! Works really great for my little crab dude!

you are my god !!

works well, thank you