Is there anyway to have more than 1 fov for the same character using dot product?

Here’s what I mean:

local RunService = game:GetService("RunService")

local npc = game.workspace:WaitForChild("R6")
local character = script.Parent

while task.wait() do	
	local npcToCharacter = (character.Head.Position - npc.Head.Position).Unit
	local npcLook = npc.Head.CFrame.LookVector

	local dotProduct = npcToCharacter:Dot(npcLook)

	if dotProduct > .55 then
		--- When being looked at
		workspace.Baseplate.Color = Color3.new(1, 0.52549, 0.52549)
		
	elseif dotProduct > .3 then
		workspace.Baseplate.Color = Color3.new(1, 0, 0)
	else
		--- When not being looked at
		workspace.Baseplate.Color = Color3.new(0.666667, 1, 0.666667)
	end
end

Check if it’s greater than 0.3 but less than 0.55, also switch around the first elseif statement and the first if statement.

if dotProduct > .3 and dotProduct < 0.55 then
		--- When being looked at
		workspace.Baseplate.Color = Color3.new(1, 0, 0)
		
	elseif dotProduct > .55 then
		workspace.Baseplate.Color = Color3.new(1, 0.52549, 0.52549)
	else
		--- When not being looked at
		workspace.Baseplate.Color = Color3.new(0.666667, 1, 0.666667)
	end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.