So I was having some trouble getting an angle that could be fed into a blendspace for a directional start animation. I found the “Calculate Direction” node and figured everything would be good. Well, it wasn’t at first. I searched answer hub and the forums, multiple people had the same problems I was having, but no solutions were to be found. I finally got it working, so I wanted to share my understanding. I don’t know if this will work with every actor/camera rotation and movement setup, but it works for my 3rd person shooter.
The first thing I realized was that the input velocity was always going to cause problems because it’s in world space. It has to be transformed into local space. In local space your forward and backwards movement will always be on the same axis no matter which way you’re facing, same with left and right. I got that working, but the rotation was still giving me issues. I guess this node was designed for a different setup than what my custom controller implements, because to get the output that I want, the input rotation should always be 0, 0, 0. The actor rotation is irrelevant, a 90 degree start is 90 degrees no matter which way you’re facing. This is a wild guess, but I think that this node gets the control rotation or something inside the function. That local space vector will only work when when you pass in 0 rotation, otherwise the engine think you’re making a different movement. There was one other problem, this one being as soon as the pawn starts moving you have to stop updating your output angle variable. Otherwise what happens is that the angle starts to decrease from for example 180 down to 90, this will cause it to switch from playing your 180 animation to your 90, which makes for a very ugly transition. I used anim notifies to set a bool that was used in a branch to determine if the angle variable needed to be updated. You also need to check in your transition rule if the character is moving before entering your start blendspace, because this node will give an idle output of 90.
Here’s my final setup:
(That multiplication node is there because I had my blendspace anims on the wrong sides.)
I hope what I wrote makes sense and that it helps anyone else out who has the problems that I had.