Animation not working in game but it works on Studio

Hi devs, I have made an animation. It plays when you click on a TextButton. It works when I test on Roblox Studio but it does not work in game. This is the local script script inside the button I have made:

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

local trackanimation = nil
local playability = true

function playAnimation(animationSource)
	if playability == true then
		local plr = game.Players.LocalPlayer
		trackanimation = plr.Character.Humanoid:LoadAnimation(animation)
		
		trackanimation.KeyframeReached:Connect(function()
			print ("Animation At-Ease played")
			
		end)
		trackanimation:Play()
	end
end

script.Parent.MouseButton1Click:Connect(playAnimation)

This usually happens when the animation is owned by a different player.
Do you own the animation?

I made it, so yeah, of course.

Do I need to put the animation somewhere? I just have it in my inventory because I exported it on Roblox.

Nope.
So it works in studio but there is no sign of the animation being inside the player’s character.

If this is a group game, make sure the animation is owned by the group, not you, i had this problem before

9 Likes

Oh yeah, it is a group game. How can I change the owner? Oh wait, I think I can do it exporting again the animation.

i think you can’t change the owner, you have to just export it again (as you said)