So I made a throwing animation for my game. I have the scripts and the animation and on an npc, it works perfectly fine. When I shift it over to a player however, it doesn't work. here is my localscript:
character = game.Players.LocalPlayer.Character game.ReplicatedStorage.Animation:Clone().Parent = character local animation = character.Humanoid:LoadAnimation(character:WaitForChild("Animation")) animation:Play()
in the output it says LoadAnimation requires the Humanoid object (Faazo.Humanoid) to be a descendant of the game object
What does this mean? The humanoid isn't a descendant of game
? It is though. Please help.
Try checking if humanoid is a part of the character before playing the animation, I'll give just you the script:
local character = game.Players.LocalPlayer.Character local humanoid = character:WaitForChild("Humanoid") game.ReplicatedStorage.Animation:Clone().Parent = character local animation = humanoid:LoadAnimation(character:WaitForChild("Animation")) animation:Play()
Hope this helped you with your problem! Please accept my answer if it worked for you.
MajinBluee
There should be a line that says the id of the animation, you can't pop out your animation with the power of your mind... Here is a code to make it more simple:
local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=AnimationIdhere" local animTrack = Humanoid:LoadAnimation(animation) animTrack:Play()