How to load animation on R6 Rig

I try make the animation on rig R6 ( from roblox rig builder ) but it wouln’t work.

local AnimationId = "913376220" --//Put in the id here

local Character = script.Parent
local Humanoid = Character.Humanoid

local Animator = Humanoid.Animator
local Animation = Instance.new("Animation")
Animation.Parent = Animator

Animation.AnimationId = ("rbxassetid://%d"):format(AnimationId)
local AnimationTrack = Animation:LoadAnimation(Animation)

AnimationTrack.Looped = true
AnimationTrack:Play()
1 Like

First you have to make sure you are allowed to use this animation:

Next, you have to load the animation onto the Animator

should be

Animator:LoadAnimation(Animation)

Lastly, we have to wait for the animation to be loaded in before playing it.
One way which maybe may not always work is to just stick in a task.wait() after that line.

Your final code should be something like

local AnimationId = "913376220" --//Put in the id here

local Character = script.Parent
local Humanoid = Character.Humanoid

local Animator = Humanoid.Animator

local Animation = Instance.new("Animation")
Animation.Parent = Animator
Animation.AnimationId = ("rbxassetid://%d"):format(AnimationId)

local AnimationTrack = Animator:LoadAnimation(Animation)

task.wait() -- Something that waits until the animation loads

AnimationTrack.Looped = true
AnimationTrack:Play()
1 Like

Sorry for late respond but it din’t work i try it, Keep in note that this is block avatar R6 from rig builder provided in studio

also the AnimationID is the same as the default walk animation on R6 character

Is there any other solution, i try it with R15 It work?

The rig builder imports characters with LOCALSCRIPTS

So if this is an NPC, then copy all the code in the local animation script and put it all into a server-side script.

Hope this helps!

1 Like

Can you send me the script you have to load the animation?


Also, do this.

This is because LocalScripts do not run in the Workspace.
These are all the places in which they do run.