I’m trying to break up the player’s velocity vector in to it’s basic components so I can use the (x,y) values to drive forward and lateral movement… my blend space animation looks like this:
So in my animation graph I want to extract the x-component of the velocity and use that for the ForwardMovement, the y-component for the LateralMovement; at least that’s how I assume I should be going about this.
Now in the event graph for the character’s animation blueprint, each tick I’m trying to grab the character’s velocity vector, rotate it by the character’s current rotation and then extract the x-component so I can set the current ForwardMovement variable… but I’m clearly doing something wrong:
This works if the character is moving backwards or forwards in the x-axis, but not if I start the game (from the editor) facing down any other axis (or combination of axes). In the event graph I’m dividing the x-component of the rotated vector by the max-speed of the character as the blend space is using the (-1, 1) range.
Anything obvious I’m doing wrong here? Must be the way I’m trying to rotate the velocity vector of the character, but using the raw velocity vector doesn’t really produce anything usable.
Thanks for the help!