Iusse with :GetMarkerReachedSignal()

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

Is this on the client or the server?

this is in a modulescript on the serverside

i tried loading the animation when the player joins the game in the server yet it still doesnt work

local Players         = game:GetService("Players")

local collectionservice = game:GetService("CollectionService")
function AnimLoader(hum)
	local tagged = collectionservice:GetTagged("Animation")

	for i,v in pairs(tagged) do
		local track = hum:LoadAnimation(v)
	end
end



Players.PlayerAdded:Connect(function(plr)
	local chr = plr.Character
	local hum = chr:WaitForChild("Humanoid")
	AnimLoader(hum)
	
end)



You should be playing animations on the client. The client has the ability to play animations to the character that get replicated to the server. I don’t know if the VFX gets replicated, however the animation does. Can you maybe send a screenshot of the animation timeline?

Could you explain what you mean by timeline?

Nervermind, I fixed the issue, basically there was some permission errors with a sound id in my game and for some reason it was causing some lag to the animations in my game.

1 Like

Like the timeline of the animation, like when you load the animation editor and have it selected

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