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

There is an error on hrp.Size in ZoneContriller due to hrp is nil. Changing FindFirstChild(“HumanoidRootPart”) to WaitForChild silenced this error

These are all now possible with zone:relocate() and Zone.fromRegion(cframe, size) the latest v3 release!

More details and videos here:

3 Likes

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:

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.