Why is my animation not playing?

How come my animation will not play?


I’ve tried server and local scripts but it won’t play. Here is the server script currently

local tool = script.Parent
local animtaion = script.Parent:WaitForChild("Swipe")

tool.Activated:Connect(function()
	local Animation = script.Parent.Parent.Humanoid.Animator:LoadAnimation(animtaion)
	Animation:Play()
end)

I haven’t developed for a while so I am a little rusty so I may have missed something obvious, all help appreicated.

I think you should get the character instead of script.parent.parent

2 Likes

Doesn’t change anything. For a tool to be activated, it needs to be equipped. When a tool is equipped, it’s parent is the character, and not the backpack. Therefore, the character will be script.Parent.Parent, or more simply, tool.Parent.

3 Likes

its just better ngl i know it wont change anything but its worth a try right

1 Like

It’s hard to determine on what line the error occours.
Do this:

  • Don’t load the animation every time you want to play it; load it only once!
  • Check if the Animator actually exists when the tool is activated (you may actually want to declare a variable containing it beforehand)
    ^ It should probably be there though. Are you using a custom character without it?
  • check if the animation was uploaded correctly (e.g. if it’s a group game, it should be uploaded to the group)

By the way, you misspelled the variable “animation” as “animtaion”.

3 Likes

This is somewhat common, here are some potential fixes according to sources on the DevForum:

  • Upload the animation as a group animation
  • clear your temp files by
  1. press windows button + r
  2. type “temp” without the quotation marks and hit enter
  3. delete all the files by pressing ctrl+a and hitting delete
  • clear your internet cache by
  1. press windows button + r
  2. type “cmd” without the quotation marks and hit enter
  3. type “ipconfig /flushdns” without the quotation marks and hit enter
  • Enable “Reload Assets” in the Debug Panel of Studio Settings
1 Like

you should actually check if the animation is actually made under your name and not under your group
check if the animation is actually inside the tool
check if the tool is actually being activated
if you dont have a handle make sure require handle is off

So the animation is made by the creator of the game but even in a public server i get that error. I changed up the script to look like this

local tool = script.Parent

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://13983969765"
Animation.Parent = tool
tool.Activated:Connect(function()
    local animationTrack = tool.Parent.Humanoid.Animator:LoadAnimation(Animation)
	Animation:Play()
end)

And also i still get the animationTrack inside the activation because easier to find character. Anything wrong here or is this a roblox error.

This is what I’m getting in output now from this script

do animationTrack:Play()
see if that fixes anything

dang i was so tired last night i didn’t even realise, appreicate it ill give you solution if this solved it

I’m getting same error


is this a roblox glitch because nothing is wrong with script?

local tool = script.Parent

local Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://13983969765"
Animation.Parent = tool
tool.Activated:Connect(function()
    local animationTrack = tool.Parent.Humanoid.Animator:LoadAnimation(Animation)
	animationTrack:Play()
end)

Also my friend owns animation and he owns the game but that shouldnt change anything? Maybe he needs to make animation public?

Is the game made under a group? If yes make sure the animation is actually published under the group

I was thinking it was under my mates name but no it’s actually in a group thanks alot appreciate this!

it is still giving same error even under the group. Anyone have a clue why?

You can try doing this, according to another DevForum topic that has a similar problem.

1 Like

Sorry i didn’t quite understand solution but this is even happening in roblox not just studio

Are these animations uploaded under your account?

so it is a group game and uploaded under the group

Are you the Owner of the group, and published it under the group?