My Dummy is not working

I spawned Dummy and unAnchored ‘HumanoidRootPart’
but Dummy is not working, need help
what’s matter?

local humanoid = script.Parent
local newanimation = Instance.new("Animation")
local animationid = "http://www.roblox.com/asset/?id=507771955"
newanimation.AnimationId = animationid

local animation = humanoid:LoadAnimation(newanimation)
animation:Play()
1 Like

Do you have the right dummy type?
The animation you have in the script(Which I assume you are using) is made for R15 and won’t play for R6 rig types.

1 Like

Is this a local script inside the StarterCharacterScripts folder?

What do you mean by not working? Please be more descriptive.

I found the issue, It is because you’re not using an animator object
They are used to load animations onto a humanoid.
Here is the documentation:

This is what the code should look like:

local humanoid = script.Parent
local newanimation = Instance.new("Animation")
local animationid = "http://www.roblox.com/asset/?id=507771955"
newanimation.AnimationId = animationid

local animator = Instance.new("Animator") -- Creates an animator object
animator.Parent = humanoid -- Parents it to humanoid

local animation = animator:LoadAnimation(newanimation) -- loads animation onto animator
animation:Play() -- plays it

The reason your code wasn’t working is that this is an older way of doing it. I believe it was changed to give animations more security.

1 Like

Yes And What Is The Parent You Mean In humanoid

2 issues, you forgot to parent the animation (so its parent is nil) and you should use the Animator instance to load animations instead.

local humanoid = script.Parent
local animator = Instance.new("Animator")
animator.Parent = humanoid
local newanimation = Instance.new("Animation")
newanimation.Parent = humanoid
local animationid = "rbxassetid://507771955"
newanimation.AnimationId = animationid

local animation = animator:LoadAnimation(newanimation)
animation:Play()
2 Likes

Ehh i dont think so. itll automatically create animator object if u do humanoid:LoadAnimation() while you dont have one

I didn’t for me, But It might not cause it’s a dummy

1 Like