-- Projection UI for Vulpix

local PUI = {}; -- Yes, it's pronounced pooy, it stands for Projection User Interface [service].
local TS = game.TweenService;
local HB = game["Run Service"].Heartbeat;


function PUI:UpdateUI(UI, Object, Character, CameraCF, Data) -- UI Object, NPC / Object, Player.Character, Data
	local Time = 0.08; -- was 0.16
	local Info = TweenInfo.new(
		Time,
		Enum.EasingStyle.Sine,
		Enum.EasingDirection.InOut
	);
	
	local CharPos = Character.HumanoidRootPart.CFrame.p;
	local ObjectPos = Object.CFrame.p;	
	
	local Look = CFrame.new(ObjectPos, CharPos) - ObjectPos;	 
	
	local LV = CameraCF.p;	
	-- ^ or CharPos / CameraCF.p
	local Distance = 1; -- 4
	local Projected = Object.CFrame;
	local ProjectLook = CFrame.new(Object.Position, CameraCF.p) - ObjectPos; 
	Projected = CFrame.new(ObjectPos) * CFrame.new( ProjectLook.lookVector * Distance );
	Projected = CFrame.new(Projected.p, LV);
	local Goals = {
		CFrame = Projected;
	};
	
	TS:Create(UI, Info, Goals):Play();
	--wait(Time);
end



return PUI
