Answer the question
In order to leave comments, you need to log in
When you press the same button again on the keyboard, a different action occurs. How to do?
I'm doing inventory. And I need that when I press the TAB button again, the inventory closes, not opens . How to do?
script:=
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InventoryOpen : MonoBehaviour {
public GameObject Inventory;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if( Input.GetKeyDown( KeyCode.Tab ) )
Inventory.transform.position = new Vector3(240, 173, 0);
}
}
Answer the question
In order to leave comments, you need to log in
If open, close. If closed, open. How to check the current state - come up with it yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question