I've seen it done on games before so I know it's possible.
I'm trying to create a scenario where when the player looks at an object, looks away, and looks back again, the object is removed/destroyed. I've tried using a local script, and using the function WorldToScreenPoint() with the camera but I failed tragically.
How would I accomplish this?
My failed attempt that gave me the error "Unable to cast array to Vector3"
local cam = workspace.CurrentCamera
while true do
if cam:WorldToScreenPoint({-28, 0.6, 25}) == true then --checking if anyone is looking at camera
repeat wait() until cam:WorldToScreenPoint({-28, 0.6, 25}) == false -- waits until they aren't looking at the camera
game.Workspace.Part:Destory()
end
end

1 comment
Good Question.