Animation not showing for other players?

So i have made an animation for a jetpack which works for the player, but if you look at the player from a different player, the animation will not show.
How do i fix this and why does this happen?


This is the localscript :

local Idle

if Humanoid.RigType == Enum.HumanoidRigType.R15 then
	Idle = Humanoid:LoadAnimation(script:WaitForChild("IdleR15"))
elseif Humanoid.RigType == Enum.HumanoidRigType.R6 then
	Idle = Humanoid:LoadAnimation(script:WaitForChild("Idle"))
end

Idle.Priority = Enum.AnimationPriority.Action

repeat -- repeatidly playing it to prevent issues.
	Idle:Play()
	wait(2)
until active == false

i’m not sure how you would solve the anim not playing on the server, i know for a fact that roblox automatically replicates all played animations to the server, i can give advice on how your code works with the animation
if these are idle animations you’d probably want to make them looped (in animator plugin) and while there, you can set the priority too. that said if the animation is a looped top priority one it should not require re-playing it every 2 seconds, repeat loop is not a good option. that might help fix the main issue but if not, hopefully it gives you some knowledge on how to use animations properly

try changing your loop to this:

repeat -- repeatidly playing it to prevent issues.
	Idle:Play()
    Idle.Stopped:Wait()
until active == false

That did not work. The animation is still not replicating.

You should not be using a repeat loop for a idle animation. The best way to do Idle Animations is to set Looping to true when exporting the animation. This will make it so once it’s played it will play constantly until either stopped or an animation of higher priority is played (which will the resume once the higher priority animation has finished).

There is no reason to have a loop for this.

1 Like

This is his code not mine, and btw the it really doesnt matter its both doing same thing???

It’s not doing the same thing, when the animation has loop enabled Roblox does the hard work instead of the server/client (depending on which has the repeat loop)

2 Likes

where exactly did you get that from, the animation will still be looped from roblox core scripts??? furthermore, he can just wrap it in a coroutine and create a new thread for the loop.

It is more efficient and will result in a smoother animation if you use the built in loop feature than to manually loop it. That’s just a fact.

2 Likes

It is still stress on the server none the less. Either way though it’s not a big difference it is still an unnecessary repeat loop which is already handled by roblox by toggling a simple setting.

1 Like

no its not, if you use the Animation.Stopped() event it will work just as smoothly

I did have some issues when i had looping set to true in the past, but that does not seem to happen anymore. It worked!

2 Likes

Please stop spreading false information. There is a reason certain features are built in. With the Animation.Stopped there will always be a delay as its in a loop, though not a massive delay there is still a longer delay then using the built in loop feature Roblox provides.

2 Likes

I have discovered another issue.
When i remove the jetpack and spawn it back in again, the animation will stop playing for the other players.
How do i fix this?

When the jetpack gets removed stop the idle animation, when it gets put on start it again.

Do i have to use the same idle animation? Or can i load a new one if the old one is destroyed?

Setting the action priority on the client doesn’t replicate.

Setting the action priority in the animation editor should fix the issue.

1 Like

I have set the priority on the animation editor.
The animation works for the local player but does not show for the other players.

Somehow by adding a wait after idle:Stop() and before script:Destroy() fixed the issue.

4 Likes