public GameObject canvasInstr;
private bool instr = false;
void Start () {
canvasInstr.SetActive(false);
}
void Update () {
if(Input.GetKeyDown(KeyCode.I) && !canvasInstr){
canvasInstr.SetActive(true);
instr = true;
}
else if(Input.GetKeyDown(KeyCode.I) && canvasInstr){
canvasInstr.SetActive(false);
instr = false;
}
}
I really don’t know what I am doing wrong , however this toggle only switch itself off once and never goes back on.
Please help
(Maybe has to do with the fact that I have 2 canvas with diffeent names?)
Many thanks in advance!