Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question MoveTouch not working

Discussion in 'Input System' started by Robert_Poienar, Sep 13, 2020.

  1. Robert_Poienar

    Robert_Poienar

    Joined:
    Nov 19, 2019
    Posts:
    4
    Hi,

    I'm trying to simulate a finger movement.


    Code (CSharp):
    1.  Vector2 position = new Vector2(500, 1000);
    2. var touchscreen = InputSystem.AddDevice<Touchscreen>();
    3. MoveTouch(0, position);
    I also tried to add BeginTouch and EndTouch.

    Code (CSharp):
    1. Vector2 position = new Vector2(500, 1000);
    2. Vector2 startingPosition=new Vector2(0,0);
    3. var touchscreen = InputSystem.AddDevice<Touchscreen>();
    4. BeginTouch(0, startingPosition);
    5. MoveTouch(0, position);
    6. EndTouch(0,position);
    Another attempt was adding the touchscreen device as screen parameter. In the InputDebug windows it register the events but the game is not reacting.

    Am I missing something?