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:
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
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
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
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”.