Search Unity

controlling slider from anywhere on the mobile screen

Discussion in 'Scripting' started by serefe, Jan 15, 2021.

  1. serefe

    serefe

    Joined:
    Nov 22, 2020
    Posts:
    1
    trying to come up with a script that would enable me controlling the slider I created from clicking anywhere on the screen by the amount of movement on the y axis. please help
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Note the position you first touch.

    Note the position each frame.

    The difference in the Y sounds like what you want for your input.

    Now scale it appropriately and then adjust the
    .value
    field of your slider.
     
    PraetorBlue likes this.