Search Unity

Sorry if this is a noob question, but how are touch controls handled?

Discussion in 'General Discussion' started by LuckyDucky12, Oct 2, 2019.

  1. LuckyDucky12

    LuckyDucky12

    Joined:
    Feb 5, 2016
    Posts:
    16
    So, I just finished the First Person shooter tutorial that Unity provides, and I wanted to export the game to android and IOS (I hope to turn it into a shock style survival horror thing)

    However, this would be my first time doing touch controls, and I was wondering how that thing is handled.

    I see other mobile FPSes with these fancy virtual keyboards, and I want to do that and have the game respond to external controller (MOGA or just regular PS4)
     
  2. http://learn.unity.com/ (mobile and touch control section)
     
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,191
    They're handled similar to the way you would handle buttons and axis. Just a different function with a different return type.

    https://docs.unity3d.com/ScriptReference/Input.GetTouch.html