Making it display a Gui

I am making a inventory for my game. This is part of my coding...

function Update () 
{
    Input.GetButton(Inventory)
        show.inventoryGui;
}

I typed that in and have the Inventory input set up and it gives me this error

Assets/Scripts/CharacterSave.js(50,35): UCE0001: ';' expected. Insert a semicolon at the end.

If you have any help at all please post...

Thanks in advance for anyone that helps me with this...

you like ellipses...

Is Inventory a button or a type?

`Input.GetButton()` takes a `String` defining a button configured in your input manager.

If you have defined a button Inventory, then you probably wanted

Input.GetButton("Inventory")

If you want the code to only act when the button is held down, you probably wanted

Input.GetButtonDown()

If you wanted the inventory thing to only happen when the `Input.Get...` was true, then you should put it inside of an `if` statement

if(Input.GetButtonDown("Inventory"))
    //show your GUI

What is `show` supposed to be? If `show` is an `enum`, `class` or class instance, then this is syntactically correct, but will not actually do anything.

What is `inventoryGui` supposed to be? If it is a variable of a class, then you should be assigning or changing it like `show.inventoryGui = something;`. If it is an `enum`, then you should be assigning something to have its value like `something = show.inventoryGui;`. If it is a function, you must call it with parentheses like `show.inventoryGui();`.

  1. var button : boolean;
  2. function Update()
  3. {
  4. //if user presses Tab then the GUI should appear;
  5. if (Input.GetKeyDown(KeyCode.Tab))
  6. {
  7. button = true;
  8. }
  9. //if he’s not pressing Tab anymore let’s make the GUI dissapear;
  10. if (Input.GetKeyUp(KeyCode.Tab))
  11. {
  12. button = false;
  13. }
  14. }
  15. //now let’s make our GUI;
  16. function OnGUI()
  17. {
  18. if (button == true)
  19. {
  20. // you can change the values and the text displayed as you wish;
  21. GUI.Box (Rect (100,100,100,100), “it works” );
  22. }
  23. }