Quantcast
Channel: Latest Questions by robertmathew
Viewing all articles
Browse latest Browse all 60

key release of up arrow

$
0
0

when i release the up arrow key the gui button should appear.when i press up arrow the gui button should dis appear.after the release of the up arrow only i want the gui button should appear.

    var a1 = 0;

    function Update()
                   {

   if (Input.GetKeyUp (KeyCode.UpArrow))
                     {
                     a1 =1;
                     }

                   }

     function OnGUI()
                 {
           if(a1 == 1)
                 {
      GUI.Button(Rect(100,300,100,50),"button");    
                 }

                 }

when i release the uparrow the gui button is not appearing immediately. it is appearing after a delay of time or after the three or four time the release of the up arrow. i want the gui button to appear as i first release of the up arrow.


Viewing all articles
Browse latest Browse all 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>