GetMarkerReachedSignal doesn't trigger

So i have a combat system, where i play each punch animation on input click:

-- client/local script
currentTrack = punchAnimationTracks[currentPunchPosition]
print(currentTrack)


currentTrack:Play()

currentTrack:GetMarkerReachedSignal("prepunchstate"):Connect(function(keyFrame)
	print("prepunch is reached")
	-- hitknockback(player)
end)

currentTrack.Stopped:Wait()
task.delay(0.1, function()

end)

the problem is no matter what keyframe name i use, and how much i reupload my animations it just won’t trigger, i even tried using it on the server but to no use.

check for the name, capitalization matters

i checked, its the exact name and capitalization

did you make sure that you loaded the track through the animator/humanoid? that function only works on animations loaded through the animator, like this:

local animationTrack = humanoid.Animator:LoadAnimation(workspace.animation)

animationTrack:GetMarkerReachedSignal("signal"):Connect(function()
   -- code
end)

also, I recommend using the Animator if you want to load the animation

you may also want to make sure that the animation is uploaded to the group/user of the game. you need to be 100% sure that if the game is made in a group, then upload the animation to the group. if the game is made by a user, then the user has to upload the animation themselves

i solved the problem, i used animation events instead of just renaming keyframes

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.