Why does my animation work in studio but not in game?

Hi Im Sergio and ive been building a game and i decided to see if i can play with some animations to use them in game (ive never done them before)

I made an animation and put it onto studio with and it worked perfectly fine as shown below RobloxScreenShot20210202_150624270

So as soon as i went into my game to see if it worked well, it was just a simple seat animation which wasnt what studio was showing me.
Here is the image in game :

(ignore the kitchen its not finished yet)

i used this code to allow the animation to work

seat = script.Parent
function added(child)
if (child.className==“Weld”) then
human = child.part1.Parent:FindFirstChild(“Humanoid”)
if human ~= nil then
anim = human:LoadAnimation(seat.sitanim)
anim:Play()
end
end
end

function removed(child2)
if anim ~= nil then
anim:Stop()
anim:Remove()
end
end

seat.ChildAdded:connect(added)
seat.ChildRemoved:connect(removed)

Can anyone please help, i dont know what i did wrong :confused:

2 Likes

Did you commit the scripts and publish it?

The creator of the game and the animation creator have to be the same person.
If that’s not the case then the animation wouldn’t work.

Note, the when testing is Roblox Studio you can only see your own animations work (and group animations,) unless the animation is on sale.

1 Like

i created the animation and the game is under my group, so does this mean i have to put the animation under the group ?

i published the animation yes and i commited the script

The animations have to be group animations, not your animations.
Else it wouldn’t work.

3 Likes

ah it worked, ty man. Sorry if the question wsa a bit dumb im new to this. Thanks!

Haha I just encountered this same thing thanks everyone! :+1:

1 Like