if UserInputService.VREnabled and VRUseHeadsetControls.Value==true then VRService.UserCFrameChanged:connect(function(Z,H)local S,w=H:toEulerAnglesXYZ()local e=1.2 if Z==Enum.UserCFrame.Head then if-S*e>-1 and-S*e<1 then Direction=-S*e elseif-S*e>0 then Direction=1 elseif-S*e<0 then Direction=-1 end if-w>-1 and-w<1 then Steer=-w elseif-w>0 then Steer=1 elseif-w<0 then Steer=-1 end end end)end
-- If using VR
if UserInputService.VREnabled and VRUseHeadsetControls.Value == true then
	VRService.UserCFrameChanged:connect(function(CFrametype, VRSpot)
		local x, y = VRSpot:toEulerAnglesXYZ()
		local Sensitivity = 1.2

		if CFrametype == Enum.UserCFrame.Head then
			-- Direction
			if -x * Sensitivity > -1 and -x * Sensitivity < 1 then -- Makes sure the headset isn't tilted too much
				Direction = -x * Sensitivity
			elseif -x * Sensitivity > 0 then -- Otherwise we'll go to the max speed
				Direction = 1
			elseif -x * Sensitivity < 0 then -- Otherwise we'll go to the max speed
				Direction = -1
			end

			-- Steering
			if -y > -1 and -y < 1 then -- Makes sure the headset isn't tilted too much
				Steer = -y
			elseif -y > 0 then -- Otherwise we'll go to the max speed
				Steer = 1
			elseif -y < 0 then -- Otherwise we'll go to the max speed
				Steer = -1
			end
		end
	end)
end
