I was wondering if I can use WorldToScreenPoint to see a player. I tried using a loop to detect parts of a player instead, but nothing worked.
local Camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer
local Character = workspace:WaitForChild(Player.Name)
while true do
local Vector, InScreen = Camera:WorldToScreenPoint(Character)
if InScreen then
for i, v in pairs(Character:GetChildren()) do
print("A Player has been detected!")
end
else
print("You're away!")
end
wait(1)
end

7 comments
I am getting an error on line 10 repeatedly. The error is "Unable to cast Instance to Vector3?"
Make sure the code says "instance,inscope = cam..." notice the lowercase "i" in "instance" if you use "Instance" then you're doing something else
It is lowercase, but it's still giving me a strange error.
Nevermind, I fixed it! I think you've missed .Position on line 10. I hope it's working now.
oh you're right! haha! sorry!
Hmmm... This is strange again. I am supposed to look at a different player humanoid part, not myself. How can I change this?
That is irrelevant to the post. Msg me on discord. ryan32t#6658