Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with Region3 to detect if no player is in the boundary?

Asked by 5 years ago

Hello, I've been trying to set up a local-rendering function which uses Region3's to detect which room should be rendered however I've encountered a problem where the function in the Local Module doesn't return false when there is no player in the area, the scripting is below.

local WORKSPACE = game:GetService("Workspace")

function module.CheckRegion(Region)
    local PartTable = WORKSPACE:FindPartsInRegion3WithWhiteList(Region, Player.Character:GetChildren())

    for _, v in pairs(PartTable) do
        if v then
            print "ok"
        else
            print "nokay"
        end
    end
end

Answer this question