Hi! I’m trying to set up some strafing animations and tried to use the character’s Y velocity to determine whether or not he is moving left or right.
But I found that velocity is world aligned, not local. So if my character faces south instead of north, the strafe direction is inverted.
Can I translate this to local space in my event graph by using something like the controller’s rotation somehow?
I’m basically trying to find a value I can use to see if my character is strafing left or right. I tried using the velocity Y axis, but it appears to be world space, rather than local.
I got something going, but I’m not getting the range of values I’m expecting, and I need some help re-adjusting them.
My character has a directional velocity of -300 to 300. This means that at 0, it’s moving straight forward, at 150 it’s moving diagonally, and 300 it’s moving right.
I managed to replicate this by using a rotatevector node.
It works perfectly for 0, 300 and -300, but when give my character input to move diagonally, I get a value of 212/-212 instead of 150.
So the blending of my animation doesn’t match the direction my character is actually moving, making it slightly skate across the ground.
How would I adjust this?
Edit: Figured it out! My blendspace was set up as my character movement was handled by a Speed * 360 degree Orientation setup.
Turns out my setup is 2 axis based instead. (X is forwards and backwards, while Y is left and right.)
I just had to set up my blend space accordingly. (So left and right is literally on the left and right of the blend space and not in the corners).