So, in a large PvP game, there is a whole bunch of animations going around the server, and it sounds pretty scary for anyone who takes optimization seriously.
As far as I know, you can play animations that show both on client and on server by two ways:
(1) You either do it via server script, and remote events, etc…
–OR–
(2) You do it via client by ensuring player’s humanoid has an Animator object, and loading animation there.
Question: Which method is the best for optimization? Are there any downsides to the second one? Is the second one actually valid and will show up both on server and client?
" In order for AnimationTracks to replicate correctly, it’s important to know when they should be loaded on the client (via a LocalScript or on the server (via a Script)).
If an Animator is a descendant of a Humanoid or AnimationController in a Player’s Character then animations started on that Player’s client will be replicated to the server and other clients.
If the Animator is not a descendant of a player character, its animations must be loaded and started on the server to replicate.
The Animator object must be initially created on the server and replicated to clients for animation replication to work at all. If an Animator is created locally, then AnimationTracks loaded with that Animator will not replicate.
Both Humanoid:LoadAnimation and AnimationController:LoadAnimation will create an Animator if one does not already exist. When calling LoadAnimation from LocalScripts you need to be careful to wait for the Animator to replicate from the server before calling LoadAnimation if you want character animations to replicate. You can do this with WaitForChild(“Animator”)."
I’ve read that, and that’s why I asked the question about efficiency of that method compared to classic server sided one. Maybe I am remembering wrong, but years ago, it was common to use remotes when animation had to be played on client but also show for the entirety of server.