Hello!
I’m creating a tower defense game and I have a major question to ask: What would be best for performance animations-wise?
I currently have 2 ideas, with one half-implemented.
Idea 1, which is currently Implemented, handles all the animations on the client (including the firerate). Though the server handles the damage itself. This currently causes replication problems
.
idea 2 is to handle everything on the server and have the client do nothing. I think this idea would not suffice for what I’m doing.
Any ideas?
Animation and effects should be handled on the Client. Damage & Raycasting can be done on the Server. Tower animations like focus on Target, Shoot and more can just be received from a Server → Client RemoteEvent and check if the LocalPlayer is within X distance so it can be rendered.
That’s the response I was expecting.
The bad thing about this fix is that if a tower has a high fire-rate, you would be spamming remote events.
Then you can just defer the FireClient function and only fire to the Clients that are within’ the Distance given. (The Client can also check it’s Distance to see if it is far or not)
-- Code for checking Distance and getting nearest Players
task.defer(function()
-- Loop that fires to all Clients
end)