if UserInputService.VREnabled and VRUseHeadsetControls.Value==true then VRService.UserCFrameChanged:connect(function(b,P)local v,r=P:toEulerAnglesXYZ()local x=1.2 if b==Enum.UserCFrame.Head then if-v*x>-1 and-v*x<1 then Direction=-v*x elseif-v*x>0 then Direction=1 elseif-v*x<0 then Direction=-1 end if-r>-1 and-r<1 then Steer=-r elseif-r>0 then Steer=1 elseif-r<0 then Steer=-1 end end end)end

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
