Idle animation

Does anyone know how to set an idle animation on the player?
Like in Core World, when a player does not move for a defined amount of time they start dancing.

So what you want to do is store an idle time and compare it against the current time. When a player presses an action, the idle time is then updated to the current time, meaning they are no longer idle. This way you can work out the difference to see how long they have been idle for. When they have been idle for X time, you would then broadcast to the server and change that player's animation stance (i.e. dancing). If they are no longer idle, then you need to again broadcast to the server to change their stance back. Might want to flag when this is done to prevent constant broadcasts happening.

So it will require 2 scripts, client and server. Client handles idle checking, server handles animation stance changing.

Another note is that you may want to block certain actions from be classed as idle (i.e. camera looking), and maybe even check if the player is using an emote so their stance doesn't change, as some emotes loop.