Works no issues now
AHHHH okay. Im so stupid for that sorry
alright, gonna stick with zoneplus for now, need the random point the most
Hi, what do you mean by a random point ? Being able to in any zone determine a random point in that zone and spawn to it?
in zoneplus you can call a function on any zone, and itll return a vector3 of a random point in that zone, can use that to do, anything, in my case i want to randomly spawn fireflies in set regions near the player
Hello, I have implemented this feature into my new module LessSimpleZone.
Enjoy
OOps, just remove the __metatables and it’ll work Ill be releasing a package version without them rq
New package version without protected metatables published, might take a while to update
Update: Added “LocalPlayer” as a valid :ListenTo() datatype!
Example:
local zone = Zone.fromPart(workspace.Example)
zone:BindToHeartbeat()
zone:ListenTo("LocalPlayer", "Entered", function()
print("The local player has entered the zone!")
end)
I also removed some issues regarding overlapping BVH’s with the .fromBoxes() constructor.
Is this module more performant than zoneplus? What are its drawbacks?
Ive done some comparisons and its like marginally faster for spatial queries I think (less loops and function calls than zoneplus), however the real benefit is the flexibility and simplicity this module has that allows you to optimize it yourself and even modify things to suit your needs.
However, LessSimpleZone is actually faster when it comes to :IsPointWithinZone() and :GetRandomPoint() as it does not use checker parts.
The only drawbacks I can think of is that you don’t really have as much done for you (for example calling :BindToHeartbeat() requires you to provide your own OverlapParams), and you cant really do any global zone operations (like .getTouchingZones with ZonePlus ZoneController), but because the module is flexible I think you can actually just add that yourself easily
I thought Iasked this but maybe I did not, can a zone be a mesh ?
Yes, with the LessSimpleZone module (linked in the post now!) you can do LessSimpleZone.fromBasePartsVertices(...)
and use an array of meshes (and/or parts)!
I can’t update my module with your new version
Mind sending a screenshot? 30charlimit
Hey, @athar_adv I have a problem with your module.
Basically, I have made a lootbag system and created a zone to touch them in the game with your module.
The problem is when I try touching them nothing happens, really sometimes it does what my code says and sometimes not (most of the times), I tried all, checked my code, added prints to see if it hits the box, but nothing, can you help me?
Here’s the code of the zone setup:
local newZone = Zone.new(PrimaryPart, {TrackItemEnabled = true, FireMode = "OnEnter"})
newZone:BindToHeartbeat()
newZone:ListenTo("Player", "Entered", function(player: Player)
print(player) --It does not print even tho the zone spawns
LootbagModel:Destroy()
newZone:Destroy()
AddLoot(Queue, GuiP, Loot, player)
end)
Hello, can you try using .fromPart() instead of .new()?
Also, can you try adding a print before creating the zone to see if it is being created?
Ok I’ll try, thanks!
characters