Download

Player Movement Detection

Hey Guys

I have a character (FPS) that can walk and sprint and perform other actions and are obviously idle when not doing anything. Depending on the action they are performing, I set a ‘Movement State’ variable to that action.

What i’m trying to figure out is, what is the best way to tell that the player is standing still (idle - not receiving any input)? One other thing to note, is that there are actions that can be performed while player is standing still, so I don’t want the idle action overriding the other action state, eg: Player is crafting something while not moving. I want the ‘Movement State’ to reflect Crafting rather than Idle. Hope this make sense. At the moment, when crafting, I will set the movement state to Crafting and back to idle when finished. But my main issue is how and where do I tell the player is no longer moving?

Thanks.

You can access a float “Velocity” in the CharacterMovementComponent.

Thanks. Yeah i’m using that now and have it working how I need. Thanks.