How to tell what direction I'm moving in (F/B/L/R)

I’m still rather new to Unreal and game development in general; so please, bare with me.

Basically I’m trying to find out what direction my player is moving, I need that info to dictate what type of action my player should take, for example playing different attack animations depending on the direction player in moving, or deciding what directional animation to play when my character rolls

I’m going to assume this is all wrong, but this is what I have in terms of my combat blendspace if this helps get an idea what I’m trying to achieve here

Basic logic I assume would be **bIsAttacking && Direction InRange **

When my player enters the combat blend space I have locked the rotation yaw so the player is always facing the camera direction

My current way of getting the direction I think is sound (as it’s working for my 2D BS), only problem is it isn’t being set back to 0 when I’m not moving, even with a branch to set direction back to 0 when speed is equal or less than #

This is my first attempt and making a Anim Graph and from the looks of others seen in the past, I could be doing it wrong as well.

Cheers,

It’s difficult to see where the problem might be without seeing more of your graphs. For example, the image you have at the end shows a conditional at the head, but not what the conditional is checking.
It could be your entire branch isn’t called because this conditional is “False” when your character is not moving.
I see you have an independent “Speed” variable you’re using; it could be that isn’t updating properly; perhaps try placing the result of “GetVelocity” directly into your “greater-than-or-equal” check.

It looks like your character doesn’t update when he stops moving, but immediately snaps to the proper vector when movement begins again, is this the behavior you’re describing? In that case, it’s probably that you have a conditional somewhere based on movement input being detected, or movement velocity being positive, or it could be that the combat branch has been exited so that’s preventing your entire anim branch from being run.

Perhaps in your non-combat animation branch perform a check that the character’s facing direction (GetForwardVector()) is the same as the camera’s and interpolate between the two if they are not.

I’ll mark this as solved for the time being, I may have figured it out, I’ll fumble my way to a solution I feel comfortable posting here for references sake, cheers.