- Home /
 
 
               Question by 
               Sarchophagi · Nov 13, 2014 at 09:34 PM · 
                androidguibutton  
              
 
              SetBool inside GUI.Button not working on Android
The following code works on unity's runner but not on my Android device. Maybe its because I never really set anim contents inside the code but only dragging it manually on unity IDE? Is that an usual mistake? How to fix it? I mean, how to select the animator using js code?
 #pragma strict
 
 var anim : Animator;
 
 function OnGUI () {    
     
     if (GUI.Button(Rect( 10, 10, 100, 40 ), "Walk") ) {
         anim.SetBool("walking", true);
     }
 }
 
              
               Comment
              
 
               
              Your answer