Animation Events on Standard Humanoid animations

Hello,

So the title is pretty straight forward. I’m trying to add animation events onto humanoid animations from the default Animate script, lets say the walk, the main thing I want to create is an event where with every step there’s a sound that plays as SOON as the foot touches the ground, and rather than using things like wait() I wanted to use animation events going forward since they’re more secure.

Is there some sort of way to find the active playing animations and run an animation event off that or even stop them and replace the ID to swap animations? (Really just being able to locate the animations the humanoid is playing)

Any and all help means the world. Even if you don’t leave a reply, thank you for reading.

2 Likes

Yes, of course. The animation ids are in the Roblox animate script inside each player. You can reupload those ids and then add animation events, then replacing the ids in there with the new ones.

2 Likes

I’ve tried replacing ID’s but what happens is since the original animation never stops, lets say the idle, I swap the ID but the original idle is still playing, it’ll just play a second idle over the first one and it’ll mix the animations, I need to basically do something like

local Anim = humanoid.Animations.Idle (for example)

Anim:Stop()
task.wait()
Char.Animate.Idle.AnimationID = 1fj1nfjbujfbb91u
2 Likes

You would have to loop through the current playing animations and change the ID there.

Ex:

local humanoid = character.Humanoid
For I, v in humanoid:GetPlayingAnimationTracks() do
if v.Name == “Walk” then
v.AnimationId = ID
end
end

Double check for my grammar errors as I wrote this on class with my phone xd

2 Likes

Ah, sorry. This reply is bassicly useless since you should just be replacing the original id before the game starts by making your own animate script.

2 Likes

It’s alright, it’s roblox, can’t expect them to give us easy ways to do things

1 Like

It is very easy, actually! Just start a play test, go to your character and find the “Animate” local script, copy it and paste it into startercharacterscripts and then find the walk animation id in the script and replace it with yours and it should be all done!

2 Likes

Oh no I know how to do that, I’ve done that before, but what I want to do is lets say you press Q and you play a little animation where you stance change, and by the time the animation is done, your idle animation changed, and then you press Q again to revert what it did originally without mixing animations

I attached two images explaining what I mean, the one with the green floor is the problem, and the one with the brick is the goal, on my friend’s end he sees the fists raised up in his fighting stance, but I see him differently, that happens when you change the id’s on the animate script, once an animation is already playing mid game.
image

image

1 Like

For idle anims just play a single keyframe line anim and loop it

Man. lowkey i might just make my own animate script and just add functions that if the ID of an animation changes, it stops the animation and starts it up again with the new ID cause I’m sick of trying to work with the Animate script.

Why not just play an idle animation?

Since I’d be doing this for several animations, so I might as well