Its work until the camera is behind you, i honestly don't know how to re approach this, so i'm asking the people!
this is the script below,
testLabel is the indicator testLabel2 is where this object is on the screen
local runService = game:GetService("RunService")
local players = game:GetService("Players")
local player = players.LocalPlayer
local mouse = player:GetMouse()
local camera = game.Workspace.CurrentCamera
local gui = script.Parent
local frame = gui:WaitForChild("Frame")
local testObject = game.Workspace:WaitForChild("Player 123")
local testLabel = frame:WaitForChild("TextLabel")
local testLabel2 = frame:WaitForChild("OnScreenPos")
runService.RenderStepped:connect(function()
local screenPos, show = camera:WorldToScreenPoint(testObject.CFrame.p)
local editedPos = UDim2.new(0,0,0,0) --z = the side of screen
local behiden = screenPos.z < 0 and true or false
if behiden then
--screenPos = screenPos * -1
end
local y = screenPos.y
y = math.clamp(y, 0,gui.AbsoluteSize.Y)
local x = screenPos.x
x = math.clamp(x, 0,gui.AbsoluteSize.X-10)
if not show then
if screenPos.X <= 0 then
editedPos = UDim2.new(0,0,0,y)
elseif screenPos.X >= gui.AbsoluteSize.X then
editedPos = UDim2.new(1,-10,0,y)
end
if screenPos.Y <= 0 then
editedPos = UDim2.new(0, x, 0, 0)
elseif screenPos.Y >= gui.AbsoluteSize.Y then
editedPos = UDim2.new(0, x, 1, -10)
end
end
testLabel.Position = editedPos
testLabel2.Position = UDim2.new(0,screenPos.x,0,screenPos.y)
end)

1 comment
See i found this as well, i just wasnt smart enough to convert it over, but with your help i understand now, Thank you so much, :)