How to detect player idleness?

How would i go about checking if the player is idle? Because i’d like to have an idle animation play when the player has not moved for an X amount of time.

You could declare an idle timer variable that constantly goes up and if it reaches a threshold, you play the animation. It gets reset whenever the character presses a movement button, or you store his last transform.position and whenever it is the same as his current one the timer starts.