I found this script and I want to change it, so it will warn in console when player is looking at an object, not when it is on script
local Part = workspace.uhh -- This is the part I want this script to check if is visible
local Camera = workspace.Camera
local Character = game:GetService('Players').LocalPlayer.Character
local RunService = game:GetService('RunService')
local Parameters = RaycastParams.new()
Parameters.FilterDescendantsInstances = {Character, Part}
Parameters.FilterType = Enum.RaycastFilterType.Blacklist
RunService.RenderStepped:Connect(function()
local Vector, OnScreen = Camera:WorldToViewportPoint(Part.Position)
if OnScreen then
if workspace:Raycast(Camera.CFrame.Position, Part.Position - Camera.CFrame.Position, Parameters) == nil then
warn('Part is Onscreen')
end
end
end)