I know that the client should typically be responsible for visuals and in some games this is pretty straight forward since the client might know what animations or effects should run when something happens, but I’m creating a tower defense game and the entities are controlled by the server so the client can’t really know what animations or effects to run.
So my question is if the server should tell the client what to play for example PlayAnimation:FireAllClients(entityId, animationId) or PlayEffect:FireAllClients(…) or should it just tell the client what state it’s currently in and then from there the client can figure out what animation or effect to do?
#help-and-feedback:scripting-support, more specifically. Not to be that guy, but you’ll most likely get the help you want there, especially since replication is a very annoying topic. You can change the category of existing topics by editing them.
just thought id post here since I didn’t actually have a script that I needed help with so it’s technically more of a discussion about code design rather then a specific script problem, but I guess it doesn’t matter lol.
What i Whould do is make the server dictate the state of the entity through SetAttribute(State, "State").
Then make a localscript detect when an entity is added and connect GetAttributeChangedSignal(State), and choose the animation from there but I don’t have much experience and I don’t know if too many connections would take a lot of the game’s memory