--Mobile control

function CheckMobile()
	if UserInputService.TouchEnabled == true and UseGyroSteering.Value == false then -- Won't show mobile guis if gyro is enabled
		UserInputService.ModalEnabled = true
		GuiControls.Parent = PlayerGui
	end
end

function CheckVR()
	if UserInputService.VREnabled then
		UpdateVRPos()
		
		-- Hide tool UI using VR
		if PlayerGui and PlayerGui:FindFirstChild("DisplayGui") and PlayerGui:FindFirstChild("ColorGui") then
			PlayerGui:FindFirstChild("DisplayGui").Enabled = false
			PlayerGui:FindFirstChild("ColorGui").Enabled = false
		end
		UpdateCharTrans(1,0)	
	end
end

UserInputService.InputEnded:connect(function(Key)
	if WeldObject.Value ~= nil then
		--Ends Accelerate
		if Key.KeyCode == Enum.KeyCode.W or Key.KeyCode == Enum.KeyCode.Up or Key.KeyCode == Enum.KeyCode.ButtonR2 then
			if Direction == 1 then
			Direction = 0
			end
		end
		if Key.KeyCode == Enum.KeyCode.S or Key.KeyCode == Enum.KeyCode.Down or Key.KeyCode == Enum.KeyCode.ButtonL2 then
			if Direction == -1 then
			Direction = 0
			end
		end
			--Ends Steer
			if Key.KeyCode == Enum.KeyCode.D or Key.KeyCode == Enum.KeyCode.Right then
				if Steer == 1 then
				Steer = 0
				end
			end
			if Key.KeyCode == Enum.KeyCode.A or Key.KeyCode == Enum.KeyCode.Left then
				if Steer == -1 then
				Steer = 0
				end
			end
	end
end)
