Check if player is moving unity 2d code example
Example: how to detect when a player move in unity
if(rigidbody.velocity.magnitude > 0) //Make This a small number
{
// Player is moving
}
if(rigidbody.velocity.magnitude > 0) //Make This a small number
{
// Player is moving
}