When my character resets or dies, it will give me an error saying LoadAnimation requires the Humanoid object (TtuNkK.Humanoid) to be a descendant of the game object. I went into dev forums, but none of them have worked for me. I discovered that when I print the parent of the character, it says its nil. Which is strange.. Any solutions for this? The code is in a local script parented to a tool.
local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() IdleAnim = character:WaitForChild("Humanoid"):LoadAnimation(game.ReplicatedStorage.Animations.Combat.CombatldleAnim)
I think I had an issue with this about a month or two ago. I think it's a bug.
I think, for some reason, the character variable is referencing the character that once was in the Workspace but is no longer.
I'm pretty sure it's a bug on Roblox's part.
This is what I did to get around the issue:
local player = game.Players.LocalPlayer local character repeat wait() character = player.Character until character
I don't know why, but it fixes it.