My issue is what the title is pretty much. I am using server sided, non-local scripts, for the programming. I am a bit confused about local scripts too and I have a few questions about them:
If the animation is in a local script how does everyone else see it?
For my game the speed of the animation is very important, so I have to tweak the animation speed during play, how can I trust the client with this, since I have to play the animations through a local script, do I have to go to the effort to get all running animation tracks from the humanoid etc and do it that way each time?
My main issue is that an animation I want to play for when a player is ‘exercising’ in my game stops playing when I test it out in a server. It runs perfectly fine when in studio. The reason I am asking about playing animations locally is that I think this could be a solution, however it seems extremely hard to convert to this and coordinate everything in the same way.
In studio it runs fine:
In game it works for a short while (a few seconds or so), then the player just goes into its idle position.
I would suggest putting animation in ReplicatedStorage and playing animation from LocalScript. Then, making animation a loop. Keeping AnimationTrack(It is what you receive when you :LoadAnimation()) somewhere you know and stop when you need to. Looping the animation is much easier, and if you feel like when it is looped you might not know when animation is ended, you can name Keyframes and then keep track of them. Here’s an AnimationTrack event that could help you.
Thank you for the good luck, and I’ll have a go at playing the animation through a local script in the players backpack with remote events. Thanks for the link too, I can clearly see now how the animations replicate.
I still find it all very bizarre because if animations can be played locally then it seems really insecure, what’s stopping exploiters from firing the remote event at random times during the game to try and mess with things, or even play their own animations which would then replicate to the server?
Okay, I started playing the animation on the player through using remote events, and now the same thing that was happening in the server now happens in studio too. So I don’t think it’s to do with playing the animation locally.
I’m going to try changing the animation to ‘Action’ on the actual animation file on the site, see what that does.
You shouldn’t have to do this if you uploaded your custom animation with a priority higher than Core (which is any other option). Occasionally in the past, some Roblox animation packs have been accidentally uploaded with higher priority animations in them, so if you find one pack in particular whose Idle animation interrupts things, please let us know!