Search Unity

EventTrigger.OnUpdateSelected not working on mobile

Discussion in 'Scripting' started by PvTGreg, Apr 25, 2016.

  1. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    as the titles says its not working on mobile but works on pc. unity answers is dead and have been waiting on a answer for 2 weeks. why does this not work on mobile. what im trying to achieve is when you press and hold on a button it shrinks or grows an object. it works fine on pc. the pressed and released functions work just now the grow/shrink on mobile Capture.PNG

    Code (JavaScript):
    1. function Shrink(){
    2.     if(obj != null && pressed == true)
    3.     obj.transform.localScale -= Vector3.one * speed * Time.deltaTime;
    4. }
    5. function Grow(){
    6.     if(obj != null && pressed == true)
    7.     obj.transform.localScale += Vector3.one * speed * Time.deltaTime;
    8. }
    9.  
    10. function Pressed(){
    11.     pressed = true;
    12. }
    13. function Released(){
    14.     pressed = false;
    15. }
     
  2. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    also why is unity answers dead?
     
  3. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    which "mobile"? they all work differently...
     
  4. PvTGreg

    PvTGreg

    Joined:
    Jan 29, 2014
    Posts:
    365
    android