nanoblox / core

https://nanoblox.github.io/core/
Mozilla Public License 2.0
57 stars 18 forks source link

Should Zone+ support the client, or completely advise against it? #30

Closed 1ForeverHD closed 4 years ago

1ForeverHD commented 4 years ago

Zone+'s original intention is to gather a collection of players, on the server. To do this, it performs a Region3 check, to gather an array of players within a 'rough' location, then it performs a raycast check to determine precisely where this rough-group of players are. There is one use-case on the client where Zone+ can be used: when a local player wishes to gather information of a collection of people within a zone. Recently however, lots of developers have been using Zone+ on the client to detect if the single local player is within a zone. This is inefficient and incorrect, as the Region3 check does not have to be performed at all (a simple downward raycast from the local clients humanoidrootpart is all that is needed).

Solution, either:

  1. Setup warnings to make it clear that Zone+ should not be used in this way
  2. OR (preferable if possible), figure out a way to bypass this additional check on the client, whilst maintaining its original functionality
Lucke0051 commented 4 years ago

Is there an example of how they use it? If they use function Zone:getPlayer(player) I see no problem?

1ForeverHD commented 4 years ago

Zone:getPlayer(player) is the correct way to use it on the client for cases where you only one to check if your local client is in a zone, however many developers are using zone.playerAdded/playerRemoving on the client which checks for all players in a server. I may consider modifying these events and zone:initLoop() to specifically support this.

AidenRBLX commented 3 years ago

jjj