Can't load animations because humanoid isnt in workspace?

Hi,

I am having a issue with animations where I can’t load animations because the client thinks the humanoid isnt a descendant of workspace…

I get the error: Cannot load the AnimationClipProvider Service.

How do I fix this?

function Client:Equip()
	-- Load the animations
	print(self.Humanoid.Parent.Parent) -- supposed to print workspace but it prints nil..
	
	for _, anim in pairs(self.Animations:GetChildren()) do 
		self.LoadedAnimations[anim.Name] =  self.Humanoid.Animator:LoadAnimation(anim)
		self.LoadedAnimations[anim.Name].Priority = Enum.AnimationPriority.Action3 -- second highest...
	end
	
	-- Make sure Idle is looped
	self.LoadedAnimations.Idle.Looped = true
	
	-- Play the animations on equip
	self.LoadedAnimations.Equip:Play()
	self.LoadedAnimations.Idle:Play()
	
	-- Bind action for mobile and pc
	local function Attack(Action, InputState, InputType)
		self:M1(Action,InputState,InputType)
	end
	
	bind(true,
		self.GlobalSettings.M1_ACTION_NAME, 
		Attack,
		self.GlobalSettings.M1_BUTTON_IMAGE,
		self.GlobalSettings.M1_SLOT, 
		self.GlobalSettings.M1_ENUM
	);

	playSound(self.Sounds["Equip"],self.Root)
end

I suggest having a check that the character is a descendant of workspace else wait until a new character gets added.
Another thing you can do is have a wait at the start of the tool.

1 Like

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