I’ve got a quick and simple question that has been bugging me for pretty much an entire year now, but it’s critical I have it solved now.
The first time AnimationTracks are
:Play()ed in on a humanoid, it’s extremely jittery and has a sort of ‘choppy’ behavior. After the first time though, the next time the animation is called to play it runs perfectly fine. I’ve tried ContentProvider:PreloadAsync(), but the issue still persists. Why is this happening?
As long as you call LoadAnimation on the Humanoid beforehand, you should not be experiencing this.
Can you possibly send us some some footage of this happening, as well as a snippet of your code, so we can help you pinpoint the problem?
What exactly are you animating in this animation?
Yes. It’s extremely weird because even after LoadAnimation is called correctly the behavior still happens.
This is the server code snippet that shows that the animations are all preloaded correctly:
local Weapon = script.Parent.Parent
local Animations = game.ServerStorage.Animations.Single
local CP = game:GetService('ContentProvider')
local Action = Weapon.Action
local Config = Weapon.Configuration
local Speed = Config.Speed.Value / 10
local Weight = Config.Weight.Value
repeat wait() until script.Parent.Parent.Parent.Parent.Character
local Humanoid = script.Parent.Parent.Parent.Parent.Character:FindFirstChildOfClass('Humanoid')
local Equip = Humanoid:LoadAnimation(Animations.Equip)
local Idle = Humanoid:LoadAnimation(Animations.Idle)
local Block = Humanoid:LoadAnimation(Animations.Block)
local Attack1 = Humanoid:LoadAnimation(Animations.Attack1)
local Attack2 = Humanoid:LoadAnimation(Animations.Attack2)
local Attack3 = Humanoid:LoadAnimation(Animations.Attack3)
local Attack4 = Humanoid:LoadAnimation(Animations.Attack4)
Only look at the block event here. This is where it’s mainly noticeably happening.
if event == ('Equip') then
Idle:Play(0.1, Weight, Speed)
elseif event == ('Unequip') then
elseif event == ('Block') then
Block:Play(0.1, Weight, 1)
plr.Character.Humanoid.WalkSpeed = 6
elseif event == ('Unblock') then
plr.Character.Humanoid.WalkSpeed = 16
In this video, you can see that when I begin block for the first time it ‘cuts’ to the blocking position, which is abnormal behavior because, with the fade time and weight adjusted accordingly, it should smoothly interpolate into the animation. When I block a 2nd time, you can see the correct behavior is displayed.
(reply notification, see the above update I posted)
Just out of curiosity, why are you loading and playing the animations on the Server, since animations replicate?
The Developer Hub page on AnimationTracks states that it should be done from the client.
Also, you should probably preload the Tool, just in case loading it into view takes up processing power and delays the animation.
I’m going to handle them on the client. No idea why I didn’t refer to the developer hub before making this system. It’s a win-win, will most likely fix my issue, and will reduce server stress.
Why would I need to preload the tool? PreloadAsync goes through the instances passed through the array and their descendants, and loads the content if the instance’s properties contain an ID. What benefit would preloading the tool do? The animations are in ServerStorage. (moved to replicated when I fix this for running them on client)
The assets inside the Tool might not load until the tool is equipped, meaning you get delay when equipping it due to the assets loading. This has nothing to due with your issue, but is something I normally do.