Animation on Character Models

Hi, I’m not very experienced with animations and I’m having trouble replicating an animation to a character model. This is the script I have alongside the error it outputs:

local hum = script.Parent:WaitForChild("Humanoid")
local ID = "6869156130"
local asset = "rbxassetid://"
local assetID = asset..ID
local animation = Instance.new("Animation", script.Parent)
animation.AnimationId = assetID

local humAnim = hum:LoadAnimation(animation)

while true do
	if humAnim.Playing == false then
		humAnim:Play()
	end
	
	wait()
end
Playing is not a valid member of Animation "Workspace.Character Models.Ashir.Animation"  -  Server - Script:11

Try this:

local hum = script.Parent:WaitForChild("Humanoid")
local ID = "6869156130"
local asset = "rbxassetid://"
local assetID = asset..ID

local animation = Instance.new("Animation", script.Parent)
animation.AnimationId = assetID
local humAnim = hum.Animator:LoadAnimation(animation)

while true do
    if humAnim.IsPlaying == false then
        humAnim:Play()
    end
    wait()
end

If it says there is no Animator, create one and make it a descendant of Humanoid.

Playing is not a valid member of AnimationTrack "Animation"  -  Server - Script:11

It has an Animator track attached.

Playing? I use IsPlaying.

1 Like

Genuinely don’t know how I missed that, cheers

1 Like