Animation Preloading

Hello, I have this issue happening where my weapon animation is EVER SO SLIGHTLY got a delay right at the start as shown below

This is the method of preloading I’m using

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://13473416307"

local assets = {
	Animation
}

for i = 1, #assets do
	local asset = assets[i]
	ContentProvider:PreloadAsync({ asset }) -- 1 at a time, yields
end

function EquipItem()
	print("Equip Function")
	
	local Viewmodel = RSViewmodel:Clone()
	Viewmodel.Parent = PlayerCamera
	Viewmodel.Name = "Viewmodel"
	local Weapon = game.ReplicatedStorage.StoredItems["Serbu Shorty"]:Clone()
	Weapon.Parent = Viewmodel
	
	local Weld = Instance.new("Motor6D")
	Weld.Name = "HandleWeld"

	Weld.Part0 = Viewmodel.Main
	Weld.Part1 = Weapon.Handle
	
	local IdleAnimation = Viewmodel.AnimationController.Animator:LoadAnimation(Animation)
	IdleAnimation:Play()

	local WeldOffset = ItemDataModule["Serbu Shorty"].Offsets.Client
	Weld.C0 = CFrame.new(WeldOffset.Position) * WeldOffset.Rotation
	Weld.Parent = Viewmodel.Main
	print("Should have welded correctly I think")
end

Is there any way I can fix this?

Dont preload like this. Make a script in ReplicatedFirst which anything you want to preload.

1 Like

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