So I’m trying to get the default walking animation track of the player through script. I don’t know any good ways to do this so I decided to do some experimenting:
while wait() do
for _, v in pairs(char.Humanoid.Animator:GetPlayingAnimationTracks()) do
print(v.Name)
end
end
I put this method to look for the desired animation track and I did get something:
This is the supposed name of the animation track, so I develop the code into this:
local animTrack
while wait() do
for _, v in pairs(char.Humanoid.Animator:GetPlayingAnimationTracks()) do
print(v.Name)
if v.Name == "WalkAnim" then
animTrack = v
print("FOUND")
break
end
end
if animTrack then
break
end
end
And, It works:
But when I try use it here:
animTrack:GetMarkerReachedSignal("Footstep"):Connect(function()
print("Stepped!")
end)
…nothing happens. To verify, I check if the animationtrack’s animationid is the one I set, it is:
So why does nothing happen? Is there even a better way of going about this?