How can I fix this code?

local _, ok = game.Workspace.Camera:WorldToScreenPoint(game.Workspace.CoolPerson.HumanoidRootPart.Position)

if ok then
	print("AAAAAAAAAAAAAAA")
end

https://developer.roblox.com/en-us/api-reference/function/Camera/WorldToScreenPoint

while true do
	task.wait()
	local _, ok = game.Workspace.Camera:WorldToScreenPoint(game.Workspace.CoolPerson.HumanoidRootPart.Position)
	if ok then
		print("AAAAAAAAAAAAAAA")
	end
end

I assume you’re looking to perform this in a loop.

1 Like
local _, ok = workspace.CurrentCamera:WorldToScreenPoint(workspace.CoolPerson.HumanoidRootPart.Position)

if ok then
	print("AAAAAAAAAAAAAAA")
end