Is there a way to code something into an idle animation?

So let’s say I have an idle animation, and I also have several decals that I want to change the player’s face to while idling. I also want it to cancel when the player performs movement (walk, jump, ect) I’ve tried making a spawn function that has a while loop but I can see how this is probably not very efficient and could bug out. If anyone has any ideas of how I can go about this, let me know!

2 Likes

use Humnoid.Runnig Event

Humanoid.Running:Connect(Function(run)
if run > 0 then

–The Player is Running

else
– Not Running (idle)
end
end)

1 Like

will this cancel the idle code when the player moves? (i cant use studio rn) because that’s what i’m mainly looking for

yes you Can just Stop the Animation when the player is Running

if run > 0 then
–Stop the Animation

i get that, but i’m looking to how I can have a script be encoded in an idle animation that usually can not not be done with the regular animation editor. Like the face decal transparency becoming 1 at a certain time of the animation.