Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Event for when a player stops moving?

Asked by 5 years ago

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!

0
If this is for a player then you should be able to edit the script with your own idle animation id User#5423 17 — 5y
0
oh wow i'm stupid, never thought of that, thanks! KamikazeShard 23 — 5y

1 answer

Log in to vote
1
Answered by
RayCurse 1518 Moderation Voter
5 years ago
Edited 5 years ago

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.

Ad

Answer this question