For a project of mine, I’ve been loading combat animations on the server and they seem to be working fine, but after I mentioned how I did it to a friend he mentioned that it is bad to run animations on the server, and should instead be played on the client, which would automatically be replicated to the server.
Could one of you gigabrain chads explain why that is the case?
Here’s my take. It really does not matter, it just depends on your preference/what you’re trying to go for. Me personally I do animations on the client since for inputs it’s just easier like that.
loading animations on the client is a better idea instead of loading it on the server mainly for performance and such. there’s always a delay on the server when doing things, meaning loading animations on the server will always have a slight delay compared to the client. loading it on the client makes it feel more responsive and satisfying in general
that’s just my main reason for doing it tho. i recommend loading them on the client but if it works well for you then go ahead
You are most likely controlling that NPC from a server script. Therefore, load it on the server.
Is it for the player’s character (or an NPC that only exists on the client)?
You totally could handle a player’s animations from the server if you wanted to, but generally it’s more practical to handle player animations on the client.
In most games the player/client is in full control of their character, so player animations need to be played from the client to be properly synced with player inputs. Otherwise, playing animations from the server may result in input lag between an input and the animation being played.
Additionally, if every player has multiple custom animations, keeping track of all of them on the server would be cumbersome, so storing animations on the client is also easier organizationally.