Thanks for your kind words, and nice use of ZonePlus! I don’t take donations although sharing the resource to people who may benefit from it is always appreciated.
Nice! Good work! Good luck with ur next work and i’m waiting for next your works! Keep it up!
Hey, I was wondering if Zone+ will eventually come to use the new API roblox has made available which seem useful for this:
Coming as a mega update tomorrow/friday
Can I have a question on how much this would affect existing code (performance wise)? I’ve seen those benchmarks from OverHash and it seems pretty slower than now deprecated Region3 methods.
ZonePlus is currently built off EgoMoose’s RotatedRegion3 (that extends upon Region3s) which is essentially what the new API handles internally. You can be confident on Roblox supporting and improving Spatial Queries going forwards whilst this isn’t a guarantee for deprecated ones like the Region3 methods.
Because parts have 2048 studs size limit and I need to check even larger are than that may I ask if is there going to be an option (or is there already?) to create Zone without physical object (with CFrames and such)?
Last question, does ZonePlus still detect players if its in localscript?
New version, yay!
Internal Region and RotatedRegion3 checks have been entirely replaced with the new Spatial Query API. This should bring about performance gains, particularly over the long term as this API is improved.
With new Item events and methods you can now track anything. Humanoid Dummies? Check. Zombie NPCs? Check. Spaceships? Check. Pineapple Bombs? Check.
First, setup your events:
zone.itemEntered:Connect(function(item) print(("item '%s' entered the zone!"):format(item.Name)) end) zone.itemExited:Connect(function(item) print(("item '%s' exited the zone!"):format(item.Name)) end)
Then simply track any BasePart, Character or NPC you wish to have detected when entering and exiting the zones:
zone:track(zombieNPC) zone:track(spaceshipHullPart) etc
local item = character:FindFirstChild("HumanoidRootPart") zone:onItemEnter(item, function() print("The item has entered the zone!")) end)
local item = character:FindFirstChild("HumanoidRootPart") zone:onItemExit(item, function() print("The item has exited the zone!")) end)
This is useful for scenarios where you may only want to listen for an item entering/exiting a zone after a certain trigger, instead of constantly.
A frequently reported difficulty in the past has been to do with zones that rest directly next to each other. If you were creating zones for example which played and stopped music, you would often find music played/stopped incorrectly as the
entered event of one zone would fire before the
exited event of the other zone.
This can now be overcome by simply binding those zones to the same
for i = 1, 3 do local zone = Zone.new(part) zone:bindToGroup("EnterOnlyOneZoneAtATime") end
settingsGroups currently only contain one property,
onlyEnterOnceExitedAll (which defaults to
true), although can be customised in the future with ZoneController.setGroup.
You can now snap zones out of workspace with the new relocate method:
Perfectly balanced, as all things should be.
This is also accompanied with a new constructor, Zone.fromRegion, enabling the construction of zones without any containers/baseparts:
local zoneCFrame = CFrame.new() local zoneSize = Vector3.new(3000, 3000, 3000) local zone = Zone.fromRegion(zoneCFrame, zoneSize)
- By default, Zones will now only check the
Centreof characters (i.e. their HumanoidRootParts). This is because it provides performance gains and most users previously didn’t require whole-body checking. If you wish to revert back to the whole-body checking of characters, simply do:
- Replaced Maid with Janitor by @pobammer
- Replaced Signal with GoodSignal by @stravant
A full breakdown of API changes can be found here:
Found an unsual bug (which may or may not be roblox’s own), but it’s with the paint zone.
Video kinda speaks for itself on the issue.
My bad, looks like I forgot to update the paint zone at the playground! Thanks for the find, should be updated now:
May I ask if there is any improvements with zones that contains more parts? Last time I tried it, it performed really wonky.
Thanks for the amazing update keep it up Forever!
I made a slight fix to one of the whitelists for v3 although unless you’re making your zones out of hundreds of complex shapes there should be negligible difference to performance.
Can you expand on what you mean by wonky, and/or provide a way to reproduce the behaviour?
I am creating mining game and I am using zone to tag player if they’re in mine in order to calculate the depth that they’re currently on.
Video of the behavior:
Cloudfire Studio Project #3 - Roblox Studio (gyazo.com)
But as I just realized the problem is in the complex shapes, is there any chance to make something like “BoundingBox method” of all descendants, so it will ignore missing parts and just perform as a regular cube?
Is there any way to set a character as a zone and use it as a hitbox? If so, what would be the best method of doing that?
Currently using raycasting for character hitboxes and I’m not too happy with it. I need to detect when characters collide with each other.
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.fromRegion(cframe, size) the latest v3 release!
More details and videos here:
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!