:FindPartsInRegion3 incorrectly identifying WedgeParts

When using :FindPartsInRegion3(), WedgeParts will be included in the list as long as its bounding box is within the region rather than its actual shape. As you can see in the following image, I have set the lower and upper bound of the region, indicated by the two red parts.

After running the following code, the triangle part will printed out even though its actual shape isn’t within the boundaries. This is extremely problematic for games using triangle terrain where certain triangles will be at a diagonal or even vertical angle.

wait(0.2)

local Pos1 = game.Workspace.P1.Position
local Pos2 = game.Workspace.P2.Position
local Box = Region3.new(Pos1,Pos2)
local Parts = game.Workspace:FindPartsInRegion3(Box,nil,500)

for i,v in pairs(Parts) do
	print(v.Name)
end

The repo file is below.

TriangleRepo.rbxl (14.7 KB)

3 Likes

This is not a bug - it’s intended behavior.

image

See also:

4 Likes

Oh rip. So is there an alternative method aside from :GetTouchingParts() or am I stuck with this behavior?

There’s always raycasting if you run out of ideas.

Raycasting doesn’t fulfill the purpose as well though.