Search Unity

Find a players custom assigned key.

Discussion in 'Immediate Mode GUI (IMGUI)' started by Bluestrike, Nov 21, 2009.

  1. Bluestrike

    Bluestrike

    Joined:
    Sep 26, 2009
    Posts:
    256
    I'm working on a tutorial for my game.
    But since the player can remap the keys there will be issues the game displaying the wrong key.

    I don't see a input member function that can show what key is currently mapped to a input or am I not looking good enough?

    Another problem is how to add it to my text.
    I tried this but that does't work ;)
    Code (csharp):
    1. GUI.Box (Rect ((scaledResolutionWidth / 2) - 850 , 50 ,1700,150), "Hold" "FreeLook" "and move with the mouse to free look around");
    FreeLook is the input used to enable freelook (in this case the left mouse button (mouse 0)

    Ayone know a solution?
    Thanks.
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    You're right, there isn't a function to find which keys are mapped to which input axis.

    Am I right in thinking you are using this to display onscreen instructions during the game?
     
  3. Bluestrike

    Bluestrike

    Joined:
    Sep 26, 2009
    Posts:
    256
    Yep youre right :)
     
  4. paulsz

    paulsz

    Joined:
    Mar 25, 2010
    Posts:
    29
    I'm having a similar issue as Bluestrike so it's really disapointing that you cannot know how the keys are mapped onto the virtual buttons in the Input Manager.

    I want to display in my short tutorial the keys the player must press to move around and shoot but it seems there is no way of finding out the mappings of the keys that the player might have changed before starting the game.

    Is there really no way around this problem except managing somehow the key mappings yourself ? That would really suck :(

    Any help will be greatly appreciated.