Hello
Recently I have encountered this error Cannot load the AnimationClipProvider Service; attached to the following public method:
function ClientGunClass:PreloadAnimations(animations: { Animation })
local Humanoid = LocalPlayer.Character.Humanoid :: Humanoid
for _, animationObject in pairs(animations) do
RunService.RenderStepped:Wait()
self.animationsLoaded[animationObject.AnimationId] = Humanoid:LoadAnimation(animationObject)
end
end
The class on initialisation works fine, however since the class is re-started when the player respawns (the root is attached in a LocalScript of a tool), the second time around it throws this error.
I am presuming it is something to do with the fact the animations are preloaded on each spawn, but I cannot make it globalised because the humanoid resets.
I have tried waiting an abundance of seconds before firing the preloading method, however regardless of the length of the delay, this error is thrown without anomalies. I originally thought it was because of old variables, but this cannot be the case.
The public method is ran in a LocalScript of a tool, the scope can be found here:
do
...
--[[ Animations ]]--
--[[ type "Animations" is a folder, and each child of
that folder is an Animation Instance ]]--
ClientGunClass:PreloadAnimations { Animations.Rest, Animations.Armed, Animations.Pull }
end
Thanks