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

Ah, good to know. I was somewhat worried because some levels in my game could potentially have excessive numbers of object requiring tracking, and its highly unlikely that would exceed 10,000!

Side note: after trying out the example you gave above using a counter instead of :getParts(), it seemed to get confused if the player was to jump repeatedly on the zone. Sometimes the player would be stood inside and there would be no output until the player leaves and enters again.

This isn’t an issue for me anymore as I’ve decided to go down the :trackItem() route instead, but I thought it was worth mentioning. I think it may be something similar to issues mentioned a while ago with moving between zones quickly (i think it was with the 2 post process changing zones that were touching in the example place) but I could be completely wrong.

The default accuracy is ~0.1 seconds (although can be slightly longer with part events), so it sounds like the character may just be falling back down quicker than it takes for the zone to detect it outside.

There have been some limiting behaviours with the part events so we’ll likely recommend people to use the item events instead where possible in the next doc update. Feel free post more bug reports though if you find precise and reproduceable bugs with the part events.

3 Likes

After setting accuracy to Precise, it does seem to have just been what you said there.
If I find anything else I won’t hesitate to report them here!

Also, how often does the Precise accuracy check for overlaps? I know High is 10 per second, is precise per frame? After checking the accuracy Enums and seeing that the cooldown time is 0 seconds I can answer that for myself lol.
If precise is used on the client, and the client uses an fps unlocker, will that make the updates more frequent or is it tied to heartbeat / stepped?

1 Like

Checks are tied to heartbeat :+1:

3 Likes

This module can be used for swords or any weapon?, or is it not recommended?

ZonePlus is primarily intended for static items, although you could achieve this by setting accuracy to "Precise".

I’d definitely recommend checking out other resources like Raycast Hitbox and FastCast as these will be more optimal for weapons / frequently moving objects.

5 Likes

@ForeverHD Do you think it would be possible to get rid of most dependencies in the future? I think it would be beneficial for most of us, thank you :)!

By dependencies are you referring to these?

image

You wouldn’t want to remove these as they’re essential to the running of ZonePlus. ZoneController for instance handles the spatial-checking logic while Janitor helps with the tracking and cleaning of objects.

2 Likes

Okay I understand you, but would it be possible to give us option to place the modules elsewhere? For example by referencing them with Object Values?

What’s your use case for this?

You can quickly modify the location of dependencies by searching script. within the Zone and ZoneController modules and modifying the 5 lines at the top:

2 Likes

I know but doing it each time you update it is kinda “time consuming” :D.
Would it be possible if you can add something like this to the original code?

local Signal = if script.Parent:FindFirstChild("Reference_Signal") then require(script.Parent:FindFirstChild("Reference_Signal").Value) else require(script.Parent.Signal)

Or I can probably just use :FindFirstChild("...",true) instead, thanks for the replying to me tho :)!

I could certainly add a variable for script.Parent to help speed this up. For your very specific use-case it wouldn’t make sense to bloat the module for something which can be modified in a few seconds.

4 Likes

I’m having an issue with a zone. Does it fire partExited if a part inside gets destroyed? I couldn’t find any examples or replies on this.

Yes, even if the part is destroyed or teleported it will still fire the exited signal :+1:

2 Likes

Thanks for the reply, but it didn’t end up firing. I got around it by tracking the part when it enters, then using the itemExited event to see when it exited.

Good spot, just tested now and it doesn’t appear to be functioning for the part events. You’re right in using the player or item events partially instead for the time being which do detect exited as intended. I’ve opened up a ticket for that here:

2 Likes

How do I check if a zone exists?

What do you mean exactly by that? Like if it’s already defined or…?

How can i make in each zone appear something different in a gui
this is what happen to me
when i enter a zone it appears me in the gui but when i go to the other zone it doesnt.
my code:

local Zone = require(game:GetService("ReplicatedStorage").Zone)
local Test1 = workspace.RepublicaMexicanaColliders.Yucatan
local test1 = Zone.new(Test1)

local Test2 = workspace.RepublicaMexicanaColliders.Quintanaroo
local test2 = Zone.new(Test2)

test1.playerEntered:Connect(function(player)
    player.PlayerGui.EstadoDisplay.Frame.Textura.Estado.Text = ("name:".."Test1")
    player.PlayerGui.EstadoDisplay.Frame.Textura.Capital.Text = ("name:".."Test1")
    wait(0.5)
end)

test1.playerExited:Connect(function(player)
    player.PlayerGui.EstadoDisplay.Frame.Textura.Estado.Text = "you are not in a place"
    player.PlayerGui.EstadoDisplay.Frame.Textura.Capital.Text = "you are not in a place"
    wait(0.5)
end)


test2.playerEntered:Connect(function(player)
    player.PlayerGui.EstadoDisplay.Frame.Textura.Estado.Text = ("name:".."Test2")
    player.PlayerGui.EstadoDisplay.Frame.Textura.Capital.Text = ("name:".."Test2")
    wait(0.5)
end)

test2.playerExited:Connect(function(player)
    player.PlayerGui.EstadoDisplay.Frame.Textura.Estado.Text = "you are not in a place"
    player.PlayerGui.EstadoDisplay.Frame.Textura.Capital.Text = "you are not in a place"
    wait(0.5)
end)



(RobloxStudioBeta_YjJnadfYww)

Not defined, I want to find if there is any existing zones.