Animation is not playing when I click the button

I will try your ID right now and let you know if it works! :small_airplane:

	trackAnimation = plr.Character.Humanoid.Animator:LoadAnimation(animation)

Also it says this is the line of code that is having the problem every time I click on the thing in the output, it bring me to this line of code and I’m trying your ID right now.

Sadly, you’re ID did not work and I got the same thing in the output it says:
11:48:32.103 Invalid animation id ‘<error: unknown AssetId protocol>’: - Client - LocalScript:11

So it’s a client side problem on line 11 of the LocalScript

what type of script is it and under which parent?

It is a LocalScript under the textbutton.

You click on the textbutton no animation is playing and it result an error?

I think you have to check all your spelling and capitalization {Spelling mistake} {case sensitive}

try this if all of de above doesn’t work.

you also have to replace the animation ID to your one.

local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://4841405708"

local trackAnimation = nil
local playability = true

local plr = game.Players.LocalPlayer

function PlayAnimation(animationSource)
	if playability == true then
		trackAnimation = plr.Character.Humanoid.Animator:LoadAnimation(animation)

		trackAnimation.KeyframeReached:Connect(function()

		end)

		trackAnimation:Play()
	end
end

script.Parent.MouseButton1Click:Connect(PlayAnimation)
1 Like