Animation not playing [CLOSED]

So, I’m trying to make it so when you open up the shop, a viewport of a character will wave at you and then play a “static” animation where it is lying down… the animation’s aren’t playing, at all. I’m using warns to try and see what’s going on, but it wont go further than warning that it’s waving, but not waving;

Waving


This is my code:

local Shop = script.Parent.Parent.Parent.Parent.Parent:WaitForChild("Shop"):WaitForChild("Loading")
local Menu = script.Parent.Parent.Parent.Parent

local ShopDummy = Shop:WaitForChild("MaisyView").ShopDummy

local AnimationLoader = ShopDummy:WaitForChild("Humanoid"):WaitForChild("Animator")

local AnimationWave = AnimationLoader:LoadAnimation(ShopDummy:WaitForChild("Wave"))
local AnimationStatic = AnimationLoader:LoadAnimation(ShopDummy:WaitForChild("Static"))

script.Parent.MouseButton1Click:Connect(function()
	Shop.Parent.Enabled = true
	Menu.Loading.Visible = false
	--# Make sure we are not playing the animation from the previous frame
	if AnimationStatic.IsPlaying then
		warn("Stopped playing")
		AnimationStatic:Stop()
	end
	
	--# Play the wave, then begin the static run
	
	warn("Waving")
	
	AnimationWave:Play()
	AnimationWave.Stopped:Connect(function()
		warn("Beginning to play static animation")
		AnimationStatic:Play()
		AnimationStatic.Looped = true
		warn("Playing static animation")
	end)
	Menu.Loading.Visible = true
	Menu.Enabled = false
end)

And the character is unanchored, and does not have any other animations playing, so it’s not priority or anchoring issues- do you know what it is?

Forgot to mention; I’ve looked at other posts, nothing has helped so far!

Hi,

As your code references a Humanoid couldn’t you use the humanoid animation functions?

local AnimationLoader = ShopDummy:WaitForChild("Humanoid")

local AnimationWave = AnimationLoader:LoadAnimation(ShopDummy:WaitForChild("Wave"))
local AnimationStatic = AnimationLoader:LoadAnimation(ShopDummy:WaitForChild("Static"))

Edit: Forgot these were deprecated.

Also taking a closer look at your code does this happen to occur in a viewport frame?

This may help:
https://developer.roblox.com/en-us/api-reference/class/WorldModel

Furthermore you can put Humanoid characters in the WorldModel and their joints will be set-up correctly, and you can animate them.

You might’ve heard this already, devs repeat it continuosly, but remember that the animation can only play if you own it. You didn’t mention if you own it so I thought i’d mention it anyways.

1 Like

I think this might be the soloution! I’m trying it out right away!

Edit: Yes! This works, thanks for the help!

Those are depreciated, Animator is the new version of it, parented underneath Humanoid