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

Alright! Thanks for the amazing resources :smiley:

For those interested in switching to the Deferred Signal Behaviour who use ZonePlus we’ve just released an update to make it compatible:

3 Likes

Thank you so MUCH!
I’ve been struggling with zones for some time now, and you always get the solution done.

With this module I can now finally create SafeZones for people in my new game :slightly_smiling_face:

I appreciate your work for this community!

1 Like

Does credits work instead of the thread link?
Roblox doesn’t allow me to link your thread in my description.

-NH

Sure that’s absolutely fine. .

1 Like

Having an issue around legacy tools that still use mouse.Target and mouse.Hit touching on the edges of the Zone. I’ve fixed the majority of what I can with raytracing and ignoring zone parts.

Is there any plans to support not requiring zone parts inside of workspace?
I believe it possibly wouldn’t be feasible because of the use of Touched events etc.

I believe you can just make the parts in a new collision group, and make this group not collide with the default collision group.

This should prevent the default raycasting what mouse.Hit uses from colliding.

1 Like

I have 2 questions, since I am on mobile and I cannot test. If I move the Player’s character with CFrame, while this is in a zone, would the effects of the zone still happen, or they will de-activate?
And if I want to change what should trigger the event, how would that be? Because I want a simple part when entered to trigger the event, not a Player’s character.


Also great resource, I love it!!!

Yep that should be fine, they won’t deactivate assuming their body parts are still within the zone.

You can use the partEntered and exited events to achieve this. e.g.

zone.partEntered:Connect(function(part)
    print(("part '%s' entered the zone!"):format(part.Name))
end)

zone.partExited:Connect(function(part)
    print(("part '%s' exited the zone!"):format(part.Name))
end)

Do note, the part events only work for unanchored parts.

1 Like

Thank you! I asked because I am making a cube-activated-button-to-open-door thing and this really helps me, because if I use Touched and TouchEnded, the events will fire multiple times.

But how about if I move with CFrame the Player’s character outside the zone?

That should work fine too :+1:

1 Like

I have a question, if I have a model with a hollow center would ZonePlus take in all of the bounds of the model or just the parts?

It accounts for the parts within, not the boundary of the model.

1 Like

Ok, thanks for the help, and the module is amazing it has helped and made my job a lot easier!

1 Like

Instead of rotatedregion3 couldn’t you use some trig to figure out if the rootpart’s position is inside the rotated zone?

Say you have the red cube as the point and the white cube as the zone
image

Then you rotate the cube and the point around so the cube’s orientation is at 0,0,0

Then it’s easy, you just check if the point > min and point < max of the zone

You can do this method by rotating the point by -zone.Orientation with

I haven’t tested the performance difference but I think it’s fair to say this method is probably faster

Although this will just check if a point is inside a zone and not a cube inside a zone I don’t think it will matter too much

For cuboids this is fine, however without performing additional checks this won’t account for other geometries such as Spheres, Cylinders, etc and those from MeshParts and UnionParts.

As you mentioned as well, that only accounts for a singular point, whereas ZonePlus by default provides whole-body checking. It’s also important to note that player region checks are typically not performed on the zones, they’re instead performed on the characters who then determine the zones they are within.

I haven’t checked if this was a thing coming but if there is a V3 what would it have that would make it better then V2?

I believe there is a bug in Zone+. When I use my character model, it works. When I use someone else character model. It doesn’t work.

How are you applying this other character model? With HumanoidDescriptions? Setting the player.characters parent? Can you provide more reproduction steps.

2 Likes

Using HumanoidDescriptions I am providing this avatar.

A youtuber found the same bug and it takes him multiple times to get the part to work. And I am using zone+ module.

for (const [i, v] of pairs(Rewards.GetChildren())) {
		const Trigger = v.FindFirstChild("Trigger") as BasePart;
		const zone = new Zone(Trigger);
		zone.setAccuracy("Precise");
		if (Trigger) {
			zone.localPlayerEntered.Connect(() => {
				Touched(v.Name);
			});
		} else {
			warn(`"Need a Trigger Part for ${v.Name}`);
		}
	}

(Sorry its in Roblox-TS)