Search Unity

Translate touch controls into more conventional axis controls

Discussion in 'Input System' started by LordOfKspModding, Apr 24, 2021.

  1. LordOfKspModding

    LordOfKspModding

    Joined:
    Dec 8, 2016
    Posts:
    8
    Hello, I have been working on a game for PC for a while, and I want to port it to Android. I got it running smoothly and everything if I plug a game controller in, but I want to be able to use touch controls with a joystick, touch buttons for jump/attack, etc. Only problem - my entire codebase is written using the Unity input system (the older one, with Input.getAxis("Horizontal") or Input.getButtonDown()). Is there a way to implement touch controls without going through the code base, writing a touch input manager, and painstakingly swapping every call? Can I just say that "moving the finger here is equal to a joystick" and it will work seamlessly? If so, how?