Animations not loading

Hello,

Ive had a weird bug where animations are not playing for other players but are playing for me? The game is uploaded to my profile, and all the animations are uploaded to me. However, Whenever other people join the game the animations work for me but not for them. Can anyone help?

Script Im Using:

local animation = script:WaitForChild(‘Book’)
local humanoid = script.Parent:WaitForChild(‘Humanoid’)
local dance = humanoid:LoadAnimation(animation)
dance:Play()
dance.Looped = true

2 Likes
local animation = script:WaitForChild(‘Book’)
local humanoid = script.Parent:WaitForChild(‘Humanoid’)
local dance = humanoid:LoadAnimation(animation)
dance:Play()
dance.Looped = true

^ this code may run only for you but not for everyone when you running this code (as i think) on *client-side script (just a local script)

*client-side means that changes that applies in game’s environment will be replicated only for your client but not servers

3 Likes

Any good tutorials on a script that makes it able so that everyone can see it

2 Likes

I think it could be from this. Humanoid:LoadAnimation has been deprecated for a while now. You should be using Humanoid.Animator:LoadAnimation.

Try changing it to this:

local humanoid = script.Parent:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local dance = animator:LoadAnimation(animation)

The script itself should be underlining humanoid:LoadAnimation and telling you it is deprecated.

2 Likes

when class is being deprecated it being superseded by another class that has more features than deprecated class but it doesn’t mean that it cant be used in the code.

so, both Humanoid.Animator:LoadAnimation(ID) and Humanoid:LoadAnimation(ID) works but this code doesn’t solve this problem but depends where does it run

2 Likes

can you first show me where are you running the code?

Dumb it down for me a little I dont really know much about fancy language :sweat_smile:

Also sorry to bother but unless IM doing something wrong it isnt working (Broom is the name of the animation)

well, look, uhh.
can you show the hierarchy (explorer) of a script where you running this code?

1 Like

Under the Rig in workspace, Its the script and then the animation inside the script
image

1 Like

try to put your script into ServerScriptService if you want to handle server changes

oh and after you have done that, you need to change variable’s path to your rig, humanoid and animation

1 Like

Uhh not quite, animations replicate regardless of the environment in which they are ran in. The only possible way to make an animation not replicate to others is to create the Animator object on the client side and load animations through that.

1 Like

That won’t have any effect since scripts already automatically run in workspace

1 Like

Check this post out

So essentially the way to make the NPCs available for everyone to see is to upload them through a group

Yes

1 Like

Make sure its your animation (if not reupload it). Roblox doesnt allow animations from other people to load unless reloaded

1 Like