I was creating some scripts, you know...
..Dev stuff.
And I came across this error that said:
":LoadAnimation requires the Humanoid object (Sensei_Developer.Humanoid) to be a descendant of the game object"
Here's my script, BTW.
local player = game.Players.PlayerAdded:Wait()
local character = player.Character or player.CharacterAdded:Wait()
local Humanoid = character.Humanoid
local HRP = character.HumanoidRootPart
local Anim = Instance.new("Animation",script.Parent)
Anim.Name = "ChopAnim"
Anim.AnimationId = 'rbxassetid://3027147369'
local Animation = Humanoid:LoadAnimation(Anim)
local Part = script.Parent
game.ReplicatedStorage.PressedE.OnServerEvent:Connect(function()
if (HRP.Position - Part.Position).magnitude < 4.5 then
Animation:Play()
end
end)
No idea why this is happening. Can someone tell me why this is happening, so I can learn from this? Thanks!

3 comments
I never actually came across this issue, try rewriting the whole script
Not the best advice.
Uh, okay.