Search Unity

GUI.RepeatButton not functioning correctly

Discussion in 'Scripting' started by Hintze, Dec 7, 2012.

  1. Hintze

    Hintze

    Joined:
    Nov 6, 2009
    Posts:
    40
    Hi,
    I have a little problem I have encountered, I can´t get the GUI.RepeatButton to work properly on my ios device. I have the most simple setup in the scene trying to move a cube upwards when a button is pressed. This works perfectly when using the mouse but when i use the unity remote app, it only responds when tapped. Is this only happening with the app or am i going to have problem when building as well?
    Code (csharp):
    1. void OnGUI()
    2. {
    3.     if(GUI.RepeatButton(new Rect(50,210,500,500),"up"))
    4.     {
    5.        transform.Translate(Vector3.forward*Time.deltaTime*50);
    6.  
    7.     }
    8. }
    thanks for your time
    Hintze