hi, what is section? the array you pass into fromParts should be purely baseparts
It is.
Zones > Sections (Hallways, Interior)
I see⦠can you try adding more parts to the zone and see if it still doesnāt work?
I have and it still doesnāt work. This is a crucial method Iām needing.
oof, if you can send a replication place ill go to my laptop and test the issue; i have a feeling i know what it is
ZoneRepo.rbxl (87.4 KB)
hi, after some testing it seems the issue is actually just with streamingenabled; waiting a bit at the start i was able to get the zones to work
if your planning to make some kinda music zone thing id recommend using collectionservice and tags because theyll be added when the instance is streamed into the client, very reliable
you can use lesssimplezone to update the volume of 1 zone continuously when new tagged zones are added (detected via collectionservice.getinstanceaddedsignal), this is what i do for the music zones in my own game
Ah did not think streaming would do that especially so close to the spawn lolā¦Thanks!
Iāll look into the LessSimpleZone, but would prob need an example of seeing how to do the updating volume part.
Hi, for some reason my code with this module doesnāt detect the parts that are children of the model āTrainā. Their collision is off.
local zoneOptions = SimpleZone.QueryOptions.new()
zoneOptions.FireMode = "OnEnter"
local collisionZone = SimpleZone.fromBox(_currentRoadsFolder.CollisionZone.CFrame, _currentRoadsFolder.CollisionZone.Size, zoneOptions)
collisionZone:BindToHeartbeat()
local debounce = true
collisionZone:ListenTo("Part", "Entered", function(part)
print(part)
if part:IsDescendantOf(Train) and debounce then
debounce = false
task.wait(10)
debounce = true
end
end)
By looking at what gets printed in the output, I also noticed that when a player goes into the zone, it only detects its HumanoidRootPart and not the rest.
What am I missing?
thanks
Hi, if this is for a train i can spot a few possible causes to the issues youāre having:
- Youāre listening for
Part
ās, if your game is R15 that means all your body parts except for the HumanoidRootPart will be a MeshPart, try listening toBasePart
/BodyPart
instead. - If your train is moving, id try using SimpleZone.fromPart() as thatāll follow the zone part
Can you try applying these fixes to see if your issues get resolved? Lmk if they donāt, thanks in advance
Thanks for replying!
The train is moving, but i dont care about the characters. (I shouldnāt have mentioned the humanoidrootpart thing)
I care about detecting when the train enters my zone, not when players enter the train or anything like that.
Yes, have an invisible, non cancollide and non canquery zonepart attached to your train parts via a weld and construct a zone using .fromPart(), itāll follow the train part
Oh, I forgot to mention, BindToHeartbeat actually uses a default OverlapParams that only includes player characters, this means you should pass your own overlapparams into it (or if you donāt wanna bother just do Zone:BindToHeartbeat(OverlapParams.new())
)
Passing my own overlapparams did the trick! Thanks man
Hi, I have a concern regarding the zoneās detection accuracy, as Iām using it for a rather competitive game.
It appears that when the zones are large (smaller zones mean smaller margin of error) thereās a fair amount of studs you can go outside of the zone without it actually registering. For most games this wouldnāt be an issue, but for my game this can be used for a fairly significant competitive edge.
Is there any way to improve the moduleās accuracy, or should I modify my current code to accomodate it?
See attached video for example.
Hi, what version of SimpleZone are you using, and do you have any invisible parts attached to the character?
Also, please send a reproduction place .rbxl file so I can debug what the issue is, thanks in advance
Hey, thank you for getting back to me! Attached youāll find the .rbxl file. Iām on v158 of SimpleZone, and Iām using the base r6 character with no further invisible parts or attachments. From my own testing, it seems that the smaller zones have very little to no margin of error, whereas the larger ones do. It does appear to ācap outā so to speak beyond a certain size. Iām not sure if this is a problem with cylinders only.
simplezonetest.rbxl (82.5 KB)
Hi, unfortunately this seems to just be a thing with Robloxās spatial query api which takes use of bounding boxes; here as you can see the bounding box does overlap with the cylinder even though it looks like my body is standing outside of it
Iām pretty sure theres no way to fix this other than using a custom checking function which uses oriented boxes instead of axis aligned boxes, which it just so happens LessSimpleZone has! (in the form of LessSimplZone:IsBoxWithinZone()
), lmk if it still doesnāt work using it
Hi, I apologize for getting back to you so late.
Unfortunately I donāt think adding a custom checker with LessSimpleZone fits my specific use case. I found out after some testing that adding a LessSimpleZone only works with two or more parts, when I only have (and need) one, and Iām not skilled enough to make it performant for checking ~200 players at once.
Thank you for taking the time to answer my questions!