-- Creates a vector which represents a direction for a projectile to travel based on the cameras CFrame
-- @param CFrame cameraCFrame
-- @return Vector3

function SpreadSimulator:GetSpreadDirection(cameraCFrame)
	
	-- Roll random angle
	local randomZ = self.rng:NextNumber(0,360)
	-- Make cframe based on random angle
	local randomAngleCFrame = CFrame.Angles(0,0,-randomZ)
	-- Rotate camera cframe
	local rotatedCFrame = cameraCFrame * randomAngleCFrame
	-- Get a random point based on the circumference
	local randomMagnitude = self.rng:NextNumber(-self.currentSpread,self.currentSpread)/2
	
	-- Make spread vector based on current spread and the random point on circumference
	local spreadDirection = rotatedCFrame.UpVector * (self.currentSpread * randomMagnitude)
	

	return cameraCFrame.LookVector * Spread_Distance_From_Camera + spreadDirection 
	
end
