Animation Marker issue

I have an issue with the :GetMarkerReachedSignal() function, essentially if i play an animation for the first time it runs the function at the wrong time not at the specific keyframe, specifically at the end of the animation, when i run animation on subsequent attempts it works perfectly. i think this has something to do with the animation loading maybe? however all the animations are preloaded, so idk.

local Fist = {} local critSound = game:GetService("ReplicatedStorage").Sounds.CombatSound.Undodgeable local dmg_per_tick = 0.2 local posture_per_tick = 0.2 local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerStorage = game:GetService("ServerStorage") local debris = game:GetService("Debris") local fistcritanim = game:GetService("ReplicatedFirst").Animations.Weapons.Fist.Crit.Critical local KanjiVfx = game:GetService("ReplicatedStorage"):WaitForChild("Vfx")["Kanji effect"] local function WeldEffect(player: Player, effectPart: BasePart?, offsets)	local character = player.Character	local motor6D = Instance.new("Motor6D", effectPart)	motor6D.Part0 = player.Character:WaitForChild("Head")	motor6D.Part1 = effectPart	motor6D.C1 = CFrame.new(offsets.x, offsets.y, offsets.z) end local offsets = {	x = 0,	y = 0,	z = 0 } function Fist.Critical(plr,weapon)	local hum = plr.Character:WaitForChild("Humanoid")	local animtrack = hum:LoadAnimation(fistcritanim)	local Particale = KanjiVfx.Attachment:Clone()	Particale.Parent = plr.Character:WaitForChild("Head")	Particale.ParticleEmitter:Emit(1)	critSound:Play()	task.wait(0.1)	animtrack:GetMarkerReachedSignal("FistCrit"):Once(function()	animtrack:AdjustSpeed(0)	print("Marker Reached")	end)	--local playanimation = ReplicatedStorage.RemoteEvents.Other.PlayAnimation	animtrack:Play()	animtrack:AdjustSpeed(0.6)	debris:AddItem(Particale, 3) end return Fist 
1 Like

i think the marker like went late because the animation didnt load so like

in the fist.critical function

function Fist.Critical(plr,weapon)	local hum = plr.Character:WaitForChild("Humanoid") -- do play and stop once local warmup = hum:LoadAnimation(fistcritanim)	warmup:Play()	warmup:Stop() -- now the animation is loaded hopefully	local animtrack = hum:LoadAnimation(fistcritanim)	local Particale = KanjiVfx.Attachment:Clone()	Particale.Parent = plr.Character:WaitForChild("Head")	Particale.ParticleEmitter:Emit(1)	critSound:Play()	task.wait(0.1)	animtrack:GetMarkerReachedSignal("FistCrit"):Once(function()	animtrack:AdjustSpeed(0)	print("Marker Reached")	end)	--local playanimation = ReplicatedStorage.RemoteEvents.Other.PlayAnimation	animtrack:Play()	animtrack:AdjustSpeed(0.6)	debris:AddItem(Particale, 3) end 

add like this warmup thing

Yea i tried that, im sure the issue is something to do with the animation not loading or something, however i ran the same script in the client and it worked perfectly, so im confused.

1 Like

oh

so basically if ur asking why in the client it works perfectly but in the server it doesnt:

fistcrit is in replicatedstorage, so the client already has it when the player joins. (sent to client when player joins)

that’s why humanoid:loadanimation() works instantly on the client and the marker fires fine.

on the server, the first time it plays, the humanoid has to set it up, so the marker fires late.
doing play() → stop() on the server makes it ready, so the marker works right away.