game.Players.PlayerAdded:Connect(function(player)
wait(0.5)
local char = player.Character
local human = char:FindFirstChild("Humanoid")
local region = Region3.new(game.Workspace.Part1.Position, game.Workspace.Part2.Position)
while true do
local regionParts = game.Workspace:FindPartsInRegion3(region)
print(regionParts)
wait(1)
end
end)
Additionally debug the region 3 and make sure you set up the part’s position properly and that stuff is indeed in the region. This function should help.
local function visualizeRegion3(region3 : Region3)
local regionVisualizer = Instance.new("Part")
regionVisualizer.Transparency = 0.5
regionVisualizer.Name = "rV"
regionVisualizer.Anchored = true
regionVisualizer.Size = region3.Size
regionVisualizer.CFrame = region3.CFrame
regionVisualizer.Parent = workspace
game.Debris:AddItem(regionVisualizer,0.5)
end
Note that the order of the provided bounds matters: by switching them, the polarity of the Size components will switch. It is possible to create a Region3 with a negative volume .
The xyz values for the second vector should be greater than the xyz values for the first vector like ((0,0,0)min ,(5,5,5) max). Personally, haven’t run into this issue so I guess just try adjusting the part positions till you get it.