Search Unity

How do i detect a swipe up or swipe left using new input system for Touch Screen

Discussion in 'Input System' started by premk, Oct 20, 2019.

  1. premk

    premk

    Joined:
    Jan 4, 2015
    Posts:
    4
    i tried to use as below.
    Code (CSharp):
    1. if(context.ReadValue<float>()>1)
    2.    // swipe right
    3. else
    4.    //swipe left
    My Action Type is a Value and Control Type is Touch.
    In the Binding i used Delta/X [TouchScreen]

    The behavior i noticed whether i swipe left or right it always returns positive and hence enters only the if part.
    Can someone show me an example of how to do this using new inputsystem
     
  2. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    It is currently not implemented. But it is high priority on unity list. You need to do it yourself currently.
     
  3. Jan-Eylander

    Jan-Eylander

    Joined:
    Nov 17, 2017
    Posts:
    16
    Do we have an estimated release date for the swipe mechanics?
     
  4. GilbertoBitt

    GilbertoBitt

    Joined:
    May 27, 2013
    Posts:
    111
    for what i can see we have to get the start and end position and calculate ourselves the direction of swipe.
     
  5. cubrman

    cubrman

    Joined:
    Jun 18, 2016
    Posts:
    412
    Not implemented yet? 2 years passed...
     
    zeynepunity likes this.
  6. CypherXd

    CypherXd

    Joined:
    Apr 20, 2021
    Posts:
    2
    even not yet
     
  7. WasTabon

    WasTabon

    Joined:
    Aug 28, 2019
    Posts:
    4
    3
     
    GDevTeam likes this.
  8. dragonikus

    dragonikus

    Joined:
    Sep 29, 2010
    Posts:
    4
    soon 4)
     
  9. WasTabon

    WasTabon

    Joined:
    Aug 28, 2019
    Posts:
    4
    5