local function AnimationPlayed(animationTrack)
if animationTrack.Name ~= "RunAnim" then return end
print(animationTrack) -- prints RunAnim
animationTrack:GetMarkerReachedSignal("Step"):Connect(function()
print("STEP")
end)
end
from what ive seen in the doc you need to load the track to the humanoid then you can do GetMarkerReachedSignal
like this:
local function AnimationPlayed(animationTrack)
if animationTrack.Name ~= "RunAnim" then return end
local animTrack = humanoid:FindFirstChildOfClass("Animator"):LoadAnimation(animationTrack)
animTrack:GetMarkerReachedSignal("Step"):Connect(function()
print("STEP")
end)
end
You need a valid AnimationTrack instance to be able to listen for marker reached signals. To do this you need to load the Animation instance first through a call to the “:LoadAnimation()” method, this returns an AnimationTrack instance.
You’s obviously don’t know what AnimationPlayed is and how it works. It returns an AnimationTrack, that’s been played.
I’ve used this same method before, on custom animations I’ve done, and never needed to load the animation from the AnimationPlayed event, as it already returns a loaded animation
That’s not what my question is asking… default roblox animations load automatically… the event if fired when the animation has played… ergo the animation has already loaded, as it just played…