Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

When I try to :Play() an r15 animation it doesn't work, why?

I'm making a script which makes an animation play with an r15 character. For some reason, I can't use :Play() on Animation1. They're both action animations and it is the correct Animation ID, I just don't understand why it won't work. In output it says " Play is not a valid member of Animation" even though I've used :Play() on R6 animations and it works.

player = script.Parent.Parent.Parent.Parent.Parent.Character
local Animation1 = Instance.new("Animation")
	Animation1.AnimationId = "rbxassetid://5552495005"
local Animation2 = Instance.new("Animation")
	Animation2.AnimationId = "rbxassetid://5552499706"

local debounce = false

function One()
script.Parent.Text = "DETROIT SMASH"
	player.RightArm2.Middle.DTS.Enabled = false
	player.RightArm2.Middle.DetroitSmash:Stop()
	Animation1:Stop()
end

function Two()
	script.Parent.Text = "STOP"
	debounce = true
	player.RightArm2.Middle.DTS.Enabled = true
	player.RightArm2.Middle.DetroitSmash:Play()
	Animation1:Play()
	wait(.30)
	Animation2:Play()
	player.RightArm2.Middle.Explosion:Play()
	wait(1)
	debounce = false
end

local O = true
function onClicked() 
if O == true then
	O = false
	One()

elseif O == false then
	O = true
    Two()
end
end

script.Parent.MouseButton1Down:connect(onClicked)

If I made any grammatical errors, it'd help to point them out. Also ignore debounce because I'm practicing using that too. (The error happened before I added debounce too.)

1 answer

✓ Accepted answer

When you create animation objects, you can't just :Play() those. You have to load them into the humanoid too using

local var = humanoid:LoadAnimation(Animation1)

1 comment

0

It works, thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.