Hello
If the user is using a weaker device/phone, the distant objects (beyond few thousand studs) are not rendered/shown.
Is there a way to detect this (or to detect what is the current render distance) for the given player?
This does not help me. Most of the time it is set to 0 (Automatic)
however depending on the device, the rendering distance is very different.
I need some way to estimate what is the rendering distance for the player
This is an example of what I would do, if this doesn’t work I have no other ideas.
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local camera = game.Workspace.CurrentCamera
local function isObjectVisible(object)
local distance = (camera.CFrame.Position - object.Position).Magnitude
if distance < 5000 then
return true
else
return false
end
end
local targetObject = workspace.Part
print(isObjectVisible(targetObject))
this only checks if an object is within 5000 studs from the camera position.
it does not tell whether the object is rendered on the screen for the given player