Hide/unhide text follow Plane's SetActive.

Hello all,

Please help me create a C# script to unhide a TEXT object when Plane.SetActive = true.
my code is:

public GameObject V;
	public GameObject P;
	public GameObject plane;
	private bool M=true;

	
	void OnGUI () {

				if (M = plane.SetActive(true)) {
						V.SetActive (true);
						P.SetActive (false);
				} else {
						V.SetActive (false);
						P.SetActive (true);

				}


		}

Not correct. How can I do to it run.

Thanks you very much.

If you want to toggle the other gameObjects when plane is active use this conditional instead:

if (plane.activeSelf) {

if (plane.activeSelf) {
V.SetActive (true);
P.SetActive (false);
} else {
V.SetActive (false);
P.SetActive (true);

try this
Hope it helps you