I wonder if the first parameter (PartInstance part) of the third new function introduced (WorldRoot:GetPartsInPart) actually includes the MeshPart. If no, then this third new function is pointless since we can basically do it using the first new function
I can’t get it to work with MeshPart bones!
Is it because OverlapParams checks against part.Position and for bones should check for bone.WorldPosition (or bone. TransformedWorldCFrame.Position) ?
I think this method needs a boolean version. Bool = IsPartInPart(PartA,PartB) If I want to ask if a certain part is simply overlapping another part. Such a function may be less intensive on game performance and a lot simpler to use.
That’s what I wanna know. Though, I did run GetPartBoundsInRadius in a fast loop and its an extreme resource hog (talking like >50% CPU usage). I find that looping through the parts and checking their distance with the good old (pos1 - pos2).Magnitude was less resource intensive, but I do understand why as it’s trying to factor in the bounds of a part rather than just a simple distance check from their positions.
So your saying, that Region3, a recently deprecated thing is still faster than the new flashy OverlapParams?? Roblox can’t be that high to deprecate a system thats faster than the new one.
I mean, Region3 just takes the part positions in a square. PartBoundsInRadius takes into account the bounds of the part though. Of which is more expensive to calculate instead of just its position.
I’ve never used BoundsInRadius for object detection yet, but id imagine it would be slower because its calculating a circle if I am correct. I use GetPartsInPart for hitbox collision checking
Calculating in a circle isn’t all that expensive. It’s just a simple distance check by subtracting the 2 positions and accessing the Magnitude property.
Like this:
local distance = (pos1 - pos2).Magnitude
Or if you want to be real technical:
local distance = math.sqrt((x1-x2)^2+(y1-y2)^2+(z1-z2)^2)
The real expensive part is it has to factor in part bounds, of which it has to get every corner and point of a parts bounds and check if it is overlapping in the radius.
ah thats true, I was calculating that with my placement system detection, however when i was using it theres no issues that are really worth looking into because its all ran on the client and verified on the server
I think a function for Vector3s should be added. The function will check if the vector3 is inside the region. I think this will be helpful for people who dont want to use parts.