You can see sometimes the viewmodel hands are just straight for a split second
I don’t have any clue what is the cause of this.
This is when the player equips the weapon:
function module.equip (viewmodel, gun, hold, pullout)
local GunHandle = gun.GunComponents.Handle
local Motor6D = viewmodel:WaitForChild("RightArm").Handle
gun.Parent = viewmodel
Motor6D.Part1 = GunHandle
workspace.LocalSounds.cloth1:Play()
workspace.LocalSounds.equip1:Play()
local Hold = viewmodel.Humanoid.Animator:LoadAnimation(hold)
local PullOut = viewmodel.Humanoid.Animator:LoadAnimation(pullout)
for i,v in pairs(viewmodel.Humanoid:GetPlayingAnimationTracks()) do
v:Stop()
end
PullOut:Play()
viewmodel.Parent = workspace.CurrentCamera
PullOut.Stopped:Wait()
Hold:Play()
end
putting it on its own thread won’t change anything.
Instead of using ContentProvider you should instead try doing this:
local Hold = viewmodel.Humanoid.Animator:LoadAnimation(hold)
local PullOut = viewmodel.Humanoid.Animator:LoadAnimation(pullout)
for i,v in pairs(viewmodel.Humanoid:GetPlayingAnimationTracks()) do
v:Stop()
end
PullOut:Play(0)
viewmodel.Parent = workspace.CurrentCamera
PullOut.Stopped:Wait()
Hold:Play()
I feel like animation:KeyframeReached would work here.
naming the first keyframe in the animation could potentially allow it to load in and when the function is called make the arms visible.