Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Input.anyKey

Discussion in 'Scripting' started by Jonathan Czeck, Oct 2, 2006.

  1. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    The property Input.anyKey returns true if a mouse button is pressed down. Can anyone think of an easy way to have this apply to only things like the keyboard? Input.anyKeyOnKeyboard

    -Jon
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Code (csharp):
    1.  
    2. if (Input.anyKey  !Input.GetMouseButton(0)  !Input.GetMouseButton(1)  !Input.GetMouseButton(2) ) {
    3.     //Do whatever
    4. }
    5.  
    --Eric