Search Unity

touch input

Discussion in '2D' started by bilallenovo48, Sep 1, 2020.

  1. bilallenovo48

    bilallenovo48

    Joined:
    Aug 9, 2020
    Posts:
    1
    hello i want the script to work with touch how can i??
    this script to rotate the player around the knob sprite by the left and right arow keys
    Code (CSharp):
    1. public float moveSpeed = 600f;
    2.  
    3.     float movement = 0f;
    4.  
    5.     // Update is called once per frame
    6.     void Update()
    7.     {
    8.         movement = Input.GetAxisRaw("Horizontal");
    9.     }
    10.  
    11.     private void FixedUpdate()
    12.     {
    13.         transform.RotateAround(Vector3.zero, Vector3.forward, movement * Time.fixedDeltaTime * -moveSpeed);
    14.     }