I want to play an idle animation, but I cannot find an event for when the player stops moving. There is an event for jumping, running, etc but not really for idle.
Is this possible without having to detect velocity of the torso or something? Thanks!
You can detect when the humanoid has started idling with the StateChanged
event. However I do not recommend this for your problem has what you're trying to do has a more streamlined solution.
If you haven't noticed, every character has a script called Animate
in it that is responsible for animating the character rig. The children of the script contain various string values containing the default animations for different scenarios the character may be in. For your purposes, you want to change the idle animation only. This would look like this:
local character = ... local animate = character:WaitForChild("Animate") animate.idle.Animation1.AnimationId = <animation id> animate.idle.Animation2.AnimationId = <animation id>
You can read more about replacing default animations here.