[IMPORTANT] AnimationClipProvider Service Error

Hi guys! So I got into a problem. I’m making an FPS game, and my problem is, when I reset my character, or I just die, then the animation cant load. The output is:

Heres the structure of the objects:

If anyone can fix this, please write down to the comments, or add me on discord: ati#1509

IIRC loadanimation errors if the humanoid isn’t a descendant of workspace, try moving it there before running the loadanimation
I could be wrong, I just skimmed over the scripts

example of a fixed script
StarterPack → Pistol → LocalScript

viewModel.Parent = workspace.CurrentCamera

local animations = {
	['Hold'] = viewModel.AnimationController.Animator:LoadAnimation(viewModel.Animations.Hold);
}

if h ~= nil then
	animations['CharacterHOLD'] = h:LoadAnimation(viewModel.CharacterAnimations.pistolHold);
end

viewModel.Parent = replicatedStorage.UnequippedGuns
1 Like

i’m not sure if this works but from past experience, (this one is in starterpack hierarchy of the pistol as you noted) you should instead define the character instead from script.Parent.Parent which will refer to the tool’s parent, being the character in the equipped function because

using your method, most of the time it may accidentally define to an pre-existing “character” from before that is no longer exists

Thanks for your answer, can I add you on discord?

So I just need to change the local character value, to:

local character = script.Parent.Parent

not instantly upon the script’s existence into the explorer but rather when the tool is equipped, it will make a variable as you exactly said to change into local chr = s.P.P and stuff

this is so you can avoid the script from erroring due to “child being defined to being nil” or the module itself

Sure, can I add you too on discord, if its not a problem?

go ahead, I’ll send you a request on my bluwu account

Due to the requirement the ROBLOX feature inquires my verbal minimum to anticipate, my concluded answer is perpendicular to the direct and immediate basic classification of agreement as in the shortened and more informal phrase of “yes”.

Nice, so whats your discord name?

reygenne1#5632

my descent into madness is complete (letter requirement)

Discord says, I cant send you friend request, you should try to add me: ati#1509