Absolutely amazing, I’ll have to use this in my safezone system
Next we could probably get support for multiple workspaces?
Could be great for keeping users in the same game but different sections of the map.
Absolutely amazing, I’ll have to use this in my safezone system
Next we could probably get support for multiple workspaces?
Could be great for keeping users in the same game but different sections of the map.
Yes.
local function IsBoxEmpty(cframe, size)
local params = OverlapParams.new()
local parts
params.MaxParts = 1
parts = workspace:GetPartBoundsInBox(cframe, size, params)
if #parts > 0 then
return false
else
return true
end
end
I think these niche cases could be developers that relied on GetTouchingParts returning a blank table when CanCollide off.
There kinda already is in a way depending what you need them for: WorldModel | Roblox Creator Documentation
The documentation says “for a ViewportFrame” because that’s almost always what they’re used for, but they basically are a full Workspace of their own, which you can use for stuff like doing region queries / raycasts against secondary world that exists in ServerStorage or something like that.
Awesome change! It seems much easier than having to use Region3s.
Are these more performant than Region3 though? Just a question.
It’s just that some might still want to use it for convenience, it can be handy to use within Touched event callbacks for pars and you don’t know what WorldRoot they are in. There are no plans to replace/change it any time soon though.
Should be pretty much the same performance wise. GetPartsInPart
can just simplify things as you do not need to worry about the collision properties of the Part.
CFrame defines the center of the box, and orientation is taken into account. (updating post to clarify this)
It sure is
I think radius, but not by much. The bounds queries do not perform any narrow phase, even on meshes. They only account for the bounding box of the part.
I haven’t checked tbh . These methods are using the new optimized collision detection system exclusively. Region3 checks weren’t before, and now they do (everything is). If I get the time I could test and report a bunch of benchmarks, but also anyone could do that now
Thanks a lot, this is gonna be really useful for my placement system. Is there any performance difference between :GetTouchingParts()
and :GetPartsInPart()
? I assume its faster.
Typo: FilterDescendantsInstance
Should be FilterDescendantsInstances
What should we use instead of that function?
#workspace:GetPartBoundsInBox( cframe, size, op ) == 0
tip: you can also set OverlapParams.MaxParts
to 1, so the function early outs as soon as a single part is found.
Oh my god this is soo goos I love it. It will really change a lot, and help me out
Thanks guys
Will these new region3 functions have any performance benefits over the old ones?
I noticed a spelling error in “Workspace” you had put “Worksapce”
It’s only baseparts, so no. Zone plus is still still great tool!
Yess! Now I can hopefully continue working on my guitar hero Roblox remake!
Will we be getting a boxcasting and spherecasting implementation next? Or will line-of-sight checks fall to developers?
I swear everytime I am in the middle of developing a system using my own method you guys release a beautiful alternative and I have to go in and change what I made the same day.
Brilliant! Thank you for this!
In my game, monsters are placed in a specific directory. If the returned result can be limited to the children in the specified directory with type of “Model”, that will be more better. I will not need to traverse which part is that monster.
When there is a limit on the number, it would be even better if we can choose to filter by distance
this is cool but still please dont remove findpartsinregion3 as a lot of scripters use it. (ofc they can update it) but some games have very lively communities while still not receiving updates.
This is deprecation, not removal. It probably won’t be removed for a long time due to the amount of code that relies on it.