Alright, so basically here’s what I’m working on. I’m working on a sword system, and this is honestly the first time I work with roblox animation. It’s pretty annoying seeing as how I think I’m doing everything right; however, every single time I load a new animation, it has this insane latency. I am loading the animations in on the client because as you could imagine, playing animations on the client where the inputs are handled, the animations would play almost instantaneously. That just does not seem to be the case here. It seems to be taking forever. Here’s a gif showing what’s going on.
https://gyazo.com/d2886f182df50052cc594003f6b477b5
Here’s a bit of the code:
Animation Loading Function
function AssignAnim(id,char,name)
local track
if not char:WaitForChild('Humanoid'):FindFirstChild(name) then
local new = Instance.new('Animation')
new.AnimationId = 'rbxassetid://' .. id
new.Parent = char:WaitForChild('Humanoid')
new.Name = name
track = char:WaitForChild('Humanoid'):LoadAnimation(new)
track:Play()
else
track = char:WaitForChild('Humanoid'):LoadAnimation(char:WaitForChild('Humanoid'):FindFirstChild(name))
track:Play()
end;
return track
end;
Input Connections
uis.InputBegan:Connect(function(input,chat)
if not chat and Equipped then
if input.UserInputType == Enum.UserInputType.MouseButton2 then
blocking = true
--if curAnim then
curAnim:Stop()
curAnim = AssignAnim(animMod.Single_Sword_Anims.Block1,char,'Block')
--end
end;
end;
end)
uis.InputEnded:Connect(function(input,chat)
if not chat and Equipped then
if input.UserInputType == Enum.UserInputType.MouseButton2 then
blocking = false
--if curAnim then
curAnim:Stop()
curAnim = AssignAnim(animMod.Single_Sword_Anims.Idle,char,'Idle')
--end
end;
end;
end)
So that’s what I got. Why does it take so long to show the animations to everyone else?