Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Which is the fastest way to check if all players are within a certain distance?

Asked by 4 years ago
Edited 4 years ago

In my game there are explosions, and in order to make it seem intense I added a screen shake, however, the screen shake can only occur if they are within a certain range (roughly 50 studs or so).

Is it quicker and less strenuous to either:

For the server to cycle through all the players and check their magnitude assuming the character exists, note that the server is already doing some heavy stuff.

OR

To use the FireAllClients() event so that the client can work out the magnitude in a LocalScript.

0
First solution. Then fire clients to shake the screen. Prevents potential exploits. Don't worry about server doing heavy work, magnitude checks are very fast. If you are concerned, you can always keep an eye on script performance window. Anything less than 3% is ok. sleazel 1287 — 4y
0
I don't really mind the screen shake on the client side, as it's only a screen shake. Unless in terms of performance, it is better to go for the first one? Marmalados 193 — 4y
0
lol TheluaBanana 946 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

the second option is definitely better as u would have to tap into a client side script anyways to make the camera shake and as for performance, doesnt really matter honestly but client side should be still better in this context

Ad

Answer this question