When a player joins I want the camera to detect when I look away from the character and when I am looking at the character.

local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera

RunService.RenderStepped:Connect(function() 
	local point = -- I don't know what to put here since idk how to get the player
	local offset, onScreen = Camera:WorldToScreenPoint(point)
	if onScreen then
		game.ReplicatedStorage.LookAway.Value = false
		print("Looking away")
	else
		game.ReplicatedStorage.LookAway.Value = true
		print("Looking at character")
	end
end)

1 comment

0

That's a really good question! I have no idea though. I'm sure someone really advanced in Lua will come in and help you.