Alright guys so I have a question and was wondering how you guys think I should solve this problem. So I am creating a damage indicator for when my gun hits an object on the map. My issue is whether I should make the indicator entirely local or not, because I do damage detection on server.
On one hand, I can make it on the client and predict what damage the server should take away from the object in order to have no delay in the indicator showing up, however this can be inconsistent from time to time because the prediction of damage isn’t always accurate.
On the other hand, I can find the damage that was actually taken on the object on the server, and then relay it back to the client, ensuring the damage is accurate, but this will introduce a couple seconds of delay and can be annoying.
Anyone have any suggestions? Thanks.
Remote events aren’t that slow. Relaying from server to client shouldnt be a problem in this case.
Also, doing it from the server makes more sense to me, since youd have to figure out where the shot is coming from, and on the client, that info isnt available, unless your passing it through some other way. And if you are already passing that through then you already have a remote to do the gui side of things…
I hope I understood your question correctly… lol
I think the damage indicator should be entirely client.
You can also calculate the damage on both server and client instead of predicting it?
My suggestion would be to make a module located somewhere in replicated storage that calculates the amount of damage to deal. It takes the part it hit and returns the damage. You can call this function on the client and on the server and theoretically should get the same amount on both machines.
What I mean by predict is that I do calculate it on the client, however it varies from server to client because sometimes I’ll calculate it on the client and then the bullet misses on the server, or vise versa.
Thanks, I’ll try this and see how it goes.