//Jimmy Vegas Unity Tutorial //This script allow you to press ESC to open & close the menu var InventoryObject : GameObject; var InvStats : int; function Update () { if (Input.GetButtonDown("Cancel")) { if (InvStats == 0) { InvStats = 1; InventoryObject.SetActive(true); } else { InventoryObject.SetActive(false); InvStats = 0; } } }