I’m experiencing a AnimationClipProvider Error, and I don’t know what’s causing it

I’m trying to make a tool with a viewmodel flashlight, but the thing is the line of code is important for animating
wait()
local Player = game.Players.LocalPlayer
local tool = Player.Character:FindFirstChild("Flashlight") or Player.Backpack:FindFirstChild("Flashlight")
local char = Player.Character
local ViewModel = game.ReplicatedFirst.FlashlightVm:Clone()
local humanoid = game.Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
local Camera = workspace.Camera
local run = game:GetService("RunService")
local runService = game:GetService("RunService")
local camera = workspace.CurrentCamera
local mult = 3
local swayOffset = CFrame.new()
local lastCameraCF = workspace.CurrentCamera.CFrame
local function renderloop()
local rotation = workspace.CurrentCamera.CFrame:toObjectSpace(lastCameraCF)
local x,y,z = rotation:ToOrientation()
swayOffset = swayOffset:Lerp(CFrame.Angles(math.sin(x)*mult,math.sin(y)*mult,0), 0.1)
ViewModel.HumanoidRootPart.CFrame = ViewModel.HumanoidRootPart.CFrame * swayOffset
lastCameraCF = workspace.CurrentCamera.CFrame
end
local IdleAnim = ViewModel.Idle
local WalkAnim = ViewModel.Walk
local EquipAnim = ViewModel.Equip
local animController = ViewModel.AnimationController
local animator = animController.Animator
tool.Equipped:Connect(function()
run.RenderStepped:Connect(function()
ViewModel:SetPrimaryPartCFrame(Camera.CFrame * CFrame.new(0,0,0))
renderloop()
end)
local IdleAnimationTrack = animator:LoadAnimation(IdleAnim)
local WalkAnimationTrack = animator:LoadAnimation(WalkAnim)
local EquipAnimationTrack = animator:LoadAnimation(EquipAnim)
EquipAnimationTrack:Play()
IdleAnimationTrack:Play()
end)
This is the code, the line with the error is local IdleAnimationTrack = animator:LoadAnimation(IdleAnim), same goes with the others, anyone know what causes it?