-- Building-clip probe, CORRECTLY SCOPED. -- -- The previous version tested only PAEntryRamp*/PAExitRamp* against buildings -- and reported 0/1200 -- but its control ALSO returned 0, which makes the -- result vacuous. Worse, the part visibly speared by a tower is a Road_* -- segment, i.e. it was sitting in the control group, not the test group. -- -- This version: -- * tests EVERY drivable part (Road_*, ramps, PA surfaces) -- 21k parts -- * proves the metric can detect a hit BEFORE trusting a zero (positive -- control: a synthetic part deliberately placed inside a building) -- * reports the worst offenders with coordinates so they can be shot local ws = game:GetService("Workspace") local map = ws:FindFirstChild("Map") if not map then return "NO MAP" end local BUILDING = { Building = true, TokyoTower = true, TowerDeck = true, TowerAntenna = true, ShiodomeTower = true, TowerCrown = true, DietTower = true, RoppongiHills = true, TokyoStation = true, StationDome = true, Skytree = true, GinzaBlock = true, NationalDiet = true, BridgeTower = true, TowerCrossbeam = true, PalaceWall = true, } local function isDrivable(n) return n:match("^Road_") or n:find("Ramp") or n == "PAFloor" or n:match("^Apron") or n:match("^Slip") or n:match("^Merge") end local drive, bld = {}, {} for _, d in ipairs(map:GetDescendants()) do if d:IsA("BasePart") then if BUILDING[d.Name] then table.insert(bld, d) elseif isDrivable(d.Name) then table.insert(drive, d) end end end if #bld == 0 or #drive == 0 then return ("SCOPE FAIL drive=%d bld=%d"):format(#drive, #bld) end -- Build an OverlapParams limited to building parts only. local op = OverlapParams.new() op.FilterType = Enum.RaycastFilterType.Include op.FilterDescendantsInstances = bld op.MaxParts = 12 -- POSITIVE CONTROL: put a probe cube dead-centre inside a building and -- confirm the metric reports it. If this returns 0, the metric is broken and -- every other number below is meaningless. local target = bld[math.floor(#bld / 2)] local ctrlHits = ws:GetPartBoundsInBox(CFrame.new(target.Position), Vector3.new(4, 4, 4), op) local controlOK = #ctrlHits > 0 local hits, samples = 0, {} for _, p in ipairs(drive) do -- shrink slightly so parts merely TOUCHING a facade aren't flagged; -- we want genuine interpenetration local probe = p.Size - Vector3.new(1.5, 1.5, 1.5) if probe.X > 0.5 and probe.Y > 0.5 and probe.Z > 0.5 then local h = ws:GetPartBoundsInBox(p.CFrame, probe, op) if #h > 0 then hits += 1 if #samples < 6 then table.insert( samples, ("%s@%.0f,%.0f,%.0f in %s"):format( p.Name, p.Position.X, p.Position.Y, p.Position.Z, h[1].Name ) ) end end end end return ("CONTROL=%s (%d hits on a part inside a building) || drivable=%d bld=%d CLIPPING=%d [%s]"):format( controlOK and "PASS" or "FAIL-METRIC-BROKEN", #ctrlHits, #drive, #bld, hits, table.concat(samples, " ; ") )