You can write your topic however you want, but you need to answer these question
2. What is the issue? Include screenshots / videos if possible!
My animation isn’t working ingame, and is giving a “LoadAnimation requires the humanoid object to be a descendant of the game object” error, but it works perfectly fine and has no problems whatsoever in studio.
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve looked up stuff but nothing seems to help since all of their issues happen in studio as well.
local animator = game.Players.LocalPlayer.Character.Humanoid:WaitForChild("Animator")
local holdinganimation = animator:LoadAnimation(Tool.Holding)
Tool.Equipped:Connect(function()
holdinganimation:Play()
end)
Tool.Unequipped:Connect(function()
holdinganimation:Stop()
end)
local character = Players.LocalPlayer.Character
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local holdinganimation = animator:LoadAnimation(Tool.Holding)
Tool.Equipped:Connect(function()
holdinganimation:Play()
end)
Tool.Unequipped:Connect(function()
holdinganimation:Stop()
end)
Your problem is probably that the character variable has a parent property of a nil value at the beginning of the game so it’s still nil while the script tries to get the humanoid which means that the game thinks that the humanoid is not in the game. Have you tried redefining the character variable once you equip the tool? Sometimes studio won’t pick up these kinds of things like a game server would.