How i can align my pawn character up vector to impact normal for any Surface by blueprint?

Hello @malikcgcs,

It took a good bit of experimentation, but I think I have a solution for you. I will post my code and then explain it below.

My Code:

Explanation:
Take your Normal vector and plug it into the “RotationFromXVector” node to convert it to a Rotator(the editor will do this step for you whenever you plug a vector into a Rotator input). From here you can rotate that value by 90 degrees because your up vector is always above your pawn. Finally you plug that value into the “Set Actor Rotation” node.

I know this is a really rough explanation, so I included some code below to allow you to draw the up vector of your pawn for debugging purposes.

Show the Up Vector Code:

I hope this answer helps,

Farshooter

1 Like