Cannot load the animation Clip provider service

So for the past hour I’ve been trying to fix this error but i cant , so i decided to get some help. :sob:

Here’s the script:


– SERVICES –

local Players = game:GetService(“Players”)
local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local ContextActionService = game:GetService(“ContextActionService”)


– VARIABLES –

local player = Players.LocalPlayer
local gun = script.Parent
local mouse = player:GetMouse()
mouse.TargetFilter = workspace.FilteringFolder
local properties = require(gun.Properties)
local GunCommsEnum = require(ReplicatedStorage.Modules.Enums.GunCommsEnum)

local gunEvent = ReplicatedStorage.Remotes.GunEvent
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude

local shotCooldown = 60/properties.FireRate
local mouseButtonDown = false
local shooting = false
local reloading = false


– PRIVATE FUNCTIONS –

local function createAnimationTrack(animId) :AnimationTrack
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild(“Humanoid”)
local animator = hum:WaitForChild(“Animator”)

local animation = Instance.new("Animation")
animation.AnimationId = animId
local track = animator:LoadAnimation(animation)
game:GetService('RunService').Stepped:Wait()
return track

end

local equipTrack = createAnimationTrack(properties.Animations.Equip)
local shootTrack = createAnimationTrack(properties.Animations.Shoot)
local reloadTrack = createAnimationTrack(properties.Animations.Reload)

(JUST SAYING THIS SCRIPT IS A GUN SCRIPT)

IM MAKING MY ANIMS FFOR MY GUNS

1 Like

This is like having a faulty car and then giving it to the mechanic without telling them what the problem is.
Can you show the full error that appears in console?

2 Likes

Sorry the problem is that every time i equip my gun the equipAnim doesn’t play
always happens with the reload and shoot anim

You initially hinted at an error, do you still get an error in console? If yes, can I see a screenshot of it?

Screenshot 2024-08-01 182409

Have you tried parenting the Animation instance you created first?

i made a new instance in the script

local function createAnimationTrack(animId) :AnimationTrack
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild(“Humanoid”)
local animator = hum:WaitForChild(“Animator”)

local animation = Instance.new("Animation")
animation.AnimationId = animId
local track = animator:LoadAnimation(animation)
game:GetService('RunService').Stepped:Wait()
return track

end

Yes, but have you tried parenting it to something before local track = animator:LoadAnimation()?
Try animation.Parent = hum

tried it but still got the same error

so sorry for wasting your time but i have found out how to fix it and i heard that this error is just a bug

THE FIX:
all i did was put a wait at the very top of the local script

1 Like

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