Search Unity

Unity TouchScript

Discussion in 'Scripting' started by serhilk, Feb 2, 2015.

  1. serhilk

    serhilk

    Joined:
    Jul 10, 2013
    Posts:
    4
    Hi All!!

    I'm trying touse TouchScript to control my input from device or mouse. I want to know how can I modify the Tap example to explode the cube instead of making a tap, when I'm moving the finger over the cube?

    This way, I want to press the screen and move the finger over the cubes that will explode (without releasing the finger) and when I finally release the finger the cube stop exploding, although I tap and move the finger over the screen again.

    How can I achieve this gesture behaviour?

    Thanks in advance
     
  2. jister

    jister

    Joined:
    Oct 9, 2009
    Posts:
    1,749
    if i understand correctly try using ScreenPointToRay... only the first time you hit the cube it should explode right? if so you could do that many ways... using a tag that changes... or put them in an other layer after the first time exploding... or use a bool on them... or...
     
  3. serhilk

    serhilk

    Joined:
    Jul 10, 2013
    Posts:
    4
    the thing is while im pressing the screen and moving the figre the touched cubes shall explode until I release the screen