I’ll explaine my problem:
I’f got an object on a plane and an object in a canvas. It should be that when I press a key on the keyboard that the object A is going to be deactivated and the object B be activated, this works fine, but when I wan’t to change it back to object A to be activated and object B to be deactivated this doesn’t work?
It should be so simple but it seams that it doesn’t, is this because of the canvas?
Object A is on the plane and object B is on the Canvas.
This is my script:
if (Input.GetKeyDown (KeyCode.A) && A == true)
{
A.SetActive (false);
B.SetActive (true);
}
if (Input.GetKeyDown (KeyCode.A) && A != true) // or A == false, even tried B == true
{
A.SetActive (true);
B.SetActive (false);
}