[v.158] SimpleZone | A simple, fast and new Zone module!

this module doesn’t work with meshparts?

 local zoneModule = require(game:GetService("ServerStorage"):WaitForChild("SimpleZone"))
local zone = zoneModule.new(script.Parent)

zone:ListenTo("Player", "Entered", function(player)
	player:RemoveTag("StikeableByLightning")
	print(("%s entered the zone!"):format(player.Name))
end)

This print snothing when i enter the zone.

Hi, you forgot to call zone:BindToHeartbeat()

1 Like

if i use bindtoheartbeat, how will it be more performant than zone plus?

BindToHeartbeat actually just registers the Zone into a RunService.PostSimulation loop which all other zones use, it’s the same system ZonePlus uses

I decided not to change the name since:

  1. It’s pretty clear what it functionally does
  2. Backwards compatibility :V
2 Likes

Your zone module seems to be inaccurate for meshparts. zoneplus is much more accurate… is less simple zone more accurate for meshparts?

1 Like

yeah but it cost lil bit more perf and took alot of memory (zoneplus had some memory leaks there) over simplezone/lesssimplezone

1 Like

Hi, SimpleZone and ZonePlus both use getpartsinpart for meshparts… can you share a video of the issue? I’ll see if i can replicate it

1 Like

SimpleZoneVSZonePlusMeshPartTest.rbxl (149.0 KB)
Here is a place file showing what I am talking about. You might need to go to different parts of the dome to see the difference clearly which is why I’ve added in a magic carpet.

2 Likes

Hello, I can replicate the issue. I’ll see whats causing it and will be pushing an update if I can fix it

2 Likes

I have been able to work around the issue by using a smaller dome within that dome as it seems your module just makes a slightly larger zone than zoneplus. EDIT: i had to use maths because neither zoneplus nor simple zone was sufficient.

1 Like

Hi, it seems that this is because ZonePlus uses .Touched, via this chain of function calls:

Create .playerEntered in constructor → Calls ZoneController:_registerConnection → Calls Zone:_formTouchedConnection → Calls Zone:_updateTouchedConnection → Connects to zonePart.Touched

Honestly I don’t really know how I’d fix this other than also using .Touched, but I don’t really know if that is ideal

2 Likes

hey i have been facing this issue a lot just wanted to know if the fault is in the module or my goofy scripts

Hi, this is an issue with SimpleSignal version 68 and below, please make sure the SimpleSignal dependency is at version 69 by updating it or downloading the latest SimpleZone release

2 Likes

Nice module, very useful and powerful!
But would u like to put it on wally? That would be helpful

1 Like

I dunno if I’m gonna put it on Wally since because I do all development on Studio it’d require me to port the module to typescript (iirc) for current and all future updates, which I honestly can’t be bothered to do :skull:

Package Version 117:

  • Fixed updateBVH not working correctly when the old bvh is empty

With the Zone Module, I can Easily Re-create the Sword Fight Arenas.

1 Like

Hello, would it be possible to add a method, zone:Getplayers(), it returns the players who are currently in the zone and also make an option to avoid making everything bug, I explain when I stick two zones side by side for example, two biomes and I put listen to Entered and Exited, the function which will be executed first when it will go to the other zone will be PlayerEntered, and after the function Player Existed which was in the starting zone will fire, which will make that the players will end up in no biome while he is in the other biome, yes zoneplus had these options I changed because it has a lot of bugs and it only worked 1 time out of 3

Hi, there is zone:GetItemsWhichAreA("Player")

Can you send a video/reproduction place file? I dont quite get what you mean

I’m working on a building system for my warehouse game and I’m using SimpleZone to get whether the user is in a buildzone or not and the issue I’m having right now is the zones aren’t using the right scale it seems. Whenver the frames in the top-left corner appear that’s when the zone registers I’m in it & the objects underlined are the parts with the AllowBuilding tag

local BuildMenu = {}
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PlayerService = game:GetService("Players")
local Player = PlayerService.LocalPlayer

local CollectionService = game:GetService("CollectionService")

local SimpleZone = require(ReplicatedStorage.Modules.SimpleZone)
local Options = SimpleZone.QueryOptions.new()
Options.AcceptMetadata = true

local EnterBuildZone = SimpleZone.fromParts(CollectionService:GetTagged("AllowBuilding"), Options)
EnterBuildZone:BindToHeartbeat()

function BuildMenu:Sync(Frame)
    EnterBuildZone:ListenTo("LocalPlayer", "Entered", function(player: Player, other)
        print(player, "entered a zone?")
        print(other)
        Frame.Visible = true
    end)
    
    EnterBuildZone:ListenTo("LocalPlayer", "Exited", function(player: Player, other)
        Frame.Visible = false
    end)
end
return BuildMenu