This always seems to activate even when I'm not looking at the part. I thought it was supposed to only activate if I was looking at the part. How can I use this to activate only when Parts are in view?
local function op()
for i,v in pairs(workspace:GetDescendants()) do
if v:IsA("Part") then
local visible = workspace.CurrentCamera:WorldToScreenPoint(v.Position)
if visible == true then
print(v.Name .. " is visible")
end
end
end
end
game:GetService("RunService").Hearbeat:Connect(op)
