ZonePlus v3.2.0 | Construct dynamic zones and effectively determine players and parts within their boundaries

Instead of creating multiple zones with lots of complex parts, consider making a single zone instead with one gigantic part which engulfs the whole mine (or even utilise the new Zone.fromRegion(cframe, size) constructor). This will be significantly more performant.

Thanks for the report, this has also been fixed in the latest release:

Well this isnā€™t possible but as I am now seeing Zone.fromRegion is definitely the way to go thank you so much!

1 Like

Not for ZonePlus as zones are primarily designed to be static (although we do support dynamically moving objects). It may be worth exploring other resources like Raycast Hitbox instead:

1 Like

Thanks for the update!
However, an issue occurred in my codebase that was previously working fine:


ā€˜LightningServerā€™ is a script that gets a random point from a zone every few seconds. The error occurs when calling :getRandomPoint() on the zone as you can see from the error log.

Edit: It seems zone.playerEntered and zone.playerExited donā€™t fire anymore? Iā€™m probably missing something thoughā€¦ Using the latest push from GitHub.

Hello friend, I found a very serious problem. When the character keeps moving in the Zone, the memory (physics / steps) of the server leaks seriously! I donā€™t know if you noticedļ¼Œļ¼Œļ¼Œ

-- Assuming we place ZonePlus in ReplicatedStorage

local Zone = require(game:GetService("ReplicatedStorage").Zone)

local zoneGroup = script.Parent

local zone = Zone.new(zoneGroup)

--local playerNum = script.Parent.Parent.playerNum.Value

zone.playerEntered:Connect(function(player)

if player then

script.Parent.playerNum.Value = script.Parent.playerNum.Value + 1

end

end)

zone.playerExited:Connect(function(player)

if player then

script.Parent.playerNum.Value = script.Parent.playerNum.Value - 1

end

end)

With the new ItemAdded event, I can now use this rather than my custom Region3 detector!

1 Like

Thanks for the report, opened up a ticket here:

For anyone else experiencing something similar in the meantime, ensure your zoneParts all belong to the ā€˜Defaultā€™ CollisionGroup.

2 Likes

This doesnā€™t sound ZonePlus related, although if you wanted to double-check you can always disable ZonePlus then repeat the same conditions.

As some context, the playground utilises all zone methods/events and only hovers at 0.08 MB:

Your 415.00+ MB seems unusually high, it may be worth asking about in #help-and-feedback if you canā€™t isolate the output to ZonePlus.

Thank you very much, I appreciate it!

Thank you, friend.This has nothing to do with ZonePlus,
It is caused by the character moving on the MeshPart

I did a quick check and it seems like the server allocated almost 400 MB to the ZoneController script if it is anything related.

When I am entering zone, Heartbeat falls down to 17 from original stable 60.

Used this in a weapons script to create safe zones where players couldnā€™t get damaged by the guns. I used one giant zone for this, as I only needed one for the functionality. The game it was used in is quite big, with a lot of scripts, but after putting in ZonePlus, servers were crashing after a couple of hours with insane memory usage (up to 900mb after an hour and a half.)

We tried several tests (mainly just removing it and put it back in a few times) and we narrowed down that ZoneController was the thing that was taking up all that memory. Not sure what is going on here, but I thought itā€™d be best to let you know about it here. :grinning_face_with_smiling_eyes:

I really like how simple the module is to use, and itā€™s a shame that we had to remove it. If you have any questions for conditions, etc. then Iā€™m willing to provide more information about the circumstances it was used in! :+1:

Edit:
Hold on, I just realised this has been updated since I last used it! Oops! Iā€™ll try it out again and Iā€™ll let you know as to whether the issues persist in this version!

1 Like

image

Is this normal?

@nakata1609 @caviarbro @coded_jkl These arenā€™t results weā€™ve discovered in testing although Iā€™ve DMd you so we can explore further.

This is fine yep as theyā€™re anchored/hidden/tiny parts associated to each zone. For the next update weā€™ll be moving them into an organised folder within a WorldModel inside Replicated/ServerStorage, and then only generating them on a need-only basis.

PR: Add way to link 3rd party modules (such as Janitor) through ObjectValues (I donā€™t want to have multiple of them, neither I want to overwrite things every update)

With this addition I would be able to just link the modules every update and delete built in ones.

1 Like

Great module, love it!

(This post was a bug I had but itā€™s fixed now)