Animation Script Not Working

Script not working, been trying forever.

im making rick astley concert [with songs] with remixs or live recordings, no remixs that are crap though.

--local Animation = script:WaitForChild('Animation1')


local humanoid = script.Parent:WaitForChild('Humanoid')
local humanoidroot = script.Parent:WaitForChild('HumanoidRootPart')
local dance = humanoid:LoadAnimation(script.Parent.Script.Animation1)
dance:Play()


--dance 2--
--local Animation2 = script:WaitForChild('Animation2')
--0--l00==ocal dance2 = humanoid:LoadAnimation(script.Parent.Script.Animation2)


--while true do
	--dance2()
	--wait(20)
	--dance()
---dance:Play()
--if dance.ended then
	--	wait(4) --aded wait--
	--end
	--dance2:Play()
--end

edit/:note this is an custom rig, This is an custom rig, an rick astley rig, looks kinda like rthro, rigged in mixamo, animations from mixamo

1 Like

is this a server script or local?

1 Like

ServerScript [Characters]

–1. :thinking: :grinning:

are you sure the Rick Astley model is rigged?
and are the model’s body parts are unanchored(i think the humanoid root part can stay anchored tho)?

Oh, i started studio on my other account (cause i just got unbanned here lel) so…


Yes, its rigged with bones. it’s welded, and yeah.

is the animation also published into roblox?

yes [30charcter[30charct]errewawewrrfcsdfaswfaferTHISLIMITarefasfefasefasefasf

and i also own the animation [] Yeah thats right [] so…? what could it be…
?

I also got this while trying to animte, when i animated before, etc, it worked fine, but this is probably because i set somtehing weird…?

image

yes you should check that out and set the part0

but i’ve been having the error before that

this is as far as i can go… i do think the problem is with the rig but anyhow good luck soldier.

Hopefully this solves your problem.

local Animation = script:WaitForChild('Animation1')
local Animation2 = script:WaitForChild('Animation2')
local humanoid = script.Parent:WaitForChild('Humanoid')
local humanoidroot = script.Parent:WaitForChild('HumanoidRootPart')
local dance = humanoid:LoadAnimation(script.Parent.Script.Animation1)
local dance2 = humanoid:LoadAnimation(script.Parent.Script.Animation2)

while true do
dance2:Play()
repeat wait() until dance2.IsPlaying == false
dance:Play()
repeat wait() until dance.IsPlaying == false
end

Don’t use Humanoid:LoadAnimation(). It already got deprecated. Use Animator:LoadAnimation() instead.

local Animation = script:WaitForChild('Animation1')
local Animation2 = script:WaitForChild('Animation2')
local humanoid = script.Parent:WaitForChild('Humanoid')
local animator = humanoid:WaitForChild("Animator")
local humanoidroot = script.Parent:WaitForChild('HumanoidRootPart')
local dance = animator:LoadAnimation(script.Parent.Script.Animation1)
local dance2 = animator:LoadAnimation(script.Parent.Script.Animation2)

while true do
dance2:Play()
repeat wait() until dance2.IsPlaying == false
dance:Play()
repeat wait() until dance.IsPlaying == false
end

[Copy-pasted from @RobloxNoob1203’s code]

It still works anyway though, Whats the difference?

Humanoid:LoadAnimation is deprecated meaning it will no longer get updated, but Animator:LoadAnimation will. There will be much more advancements in Animator rather than using Humanoid, since Animator will be getting updated.