I need to calculate the relative angle of the velocity in relation to the course of view:
For this I do have the “Get Management Rotation” and the “Get Velocity” of the “Pawn”
Yeah I stole the unique picture from: https://boards.unrealengine.com/development-discussion/blueprint-visual-scripting/74282-get-angle-offset-from-forward-vector-need-help
But it surely explains precisely how the “angle” must be.
Constructive values if the rate is “transferring to the precise” relative to the trying course and detrimental values if “transferring left”.
Utilizing arctan I can compute the detrimental and optimistic angle primarily based on the horizontal elements of the vector. As I’m solely eager about horizontal motion and the horizontal “course” through which my pawn is going through.
Because the “ahead vector” of the rotator makes use of a “z” part when trying up/down I figured I may use the “proper vector” and rotate it -90 degress (to the left or higher say entrance) across the “z” axis, as a result of it by no means get’s a “z” worth.
Unfortunetly if the rate vector has a “z” worth when transferring sidewards up or down the hill the angle is +270 as an alternative of -90 and reverse: