Search Unity

I Need Help Converting Controls From Mouse Click To Touch

Discussion in 'Scripting' started by ChardBurger, Jan 7, 2019.

  1. ChardBurger

    ChardBurger

    Joined:
    Oct 16, 2018
    Posts:
    4
    Hello! I'm new to mobile game developing and I need to refine my controls.

    Code (CSharp):
    1. private void OnMouseDrag()
    2.     {
    3.         rotz = Input.GetAxis("Mouse X") * rotationSpeed * Mathf.Deg2Rad;
    4.         PipeRotation.Rotate(0, 0, rotz);
    5.     }
    In game, the control is used to rotate a pipe. ((You could imagine the game Helix Jump for similar controls))

    How do I redo this with using touch input?
    Can I also ask for resources that I could read/watch about touch controls?

    Thank you so much!
     
  2. ChardBurger

    ChardBurger

    Joined:
    Oct 16, 2018
    Posts:
    4
  3. KISP

    KISP

    Joined:
    Sep 13, 2018
    Posts:
    32