GetMarkerReachedSignal not working

I am trying to make a simple combat system using animation events, but GetMarkerReachedSignal isn’t picking up the animation event

game.ReplicatedStorage.Remotes.HeavyAttack.OnServerEvent:Connect(function(plr)
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild(“Humanoid”)
local weapon = char:WaitForChild(“Weapon”).Value
local Weld = char.Torso:WaitForChild(“Motor6D”)
if Weld then
Weld.Parent = char:WaitForChild(“Right Arm”)
Weld.Part0 = char:WaitForChild(“Right Arm”)
Weld.C1 = weapon.ActiveValue.Value
end
local track = hum:LoadAnimation(weapon:WaitForChild(“Anims”):WaitForChild(“Heavy”))
track:Play()
track:GetMarkerReachedSignal(“Slash”):Connect(function()
print(“yes”)
end)
end)

Hello! This is your answer. You now need to load animations to the Animator. Which is a child of Humanoid. e.g.

local hum = -- Humanoid instance
local animator = hum.Animator
animator:LoadAnimation(AnimationObject)

Hope this helps :slight_smile:

This still didn’t work

filler text ererererer

Always connect before playing the anim, also make sure the marker name is right as well

Make sure your animation is actually loaded and playing, and not just yielding forever. I saw you used WaitForChild(), it could be delaying it forever.

Another cause could be that your animation event doesn’t actually exist. Double check the string name of the event you are waiting for actually exists. Remember, it’s case sensitive.

Also, it looks like you are setting the weapon variable to a reference to a property of the weapon, and not the actual object. I’m not sure if that’s what you intended, but that could be another reason why it doesn’t work.

-- What you might want weapon to be
local weapon = char:FindFirstChild(“Weapon”)

Please show an image of the error so I can assist you.

No error shows up in the output

The animation runs successfully, and the animation event exists, but doesn’t go through, also char:FindFirstChild(“Weapon”) is an objectValue with the value being the actual weapon object