Trying to Activate game object on condition

I am trying to activate my gameobject when my “player” y position is set to my PlayerHeight float. This code is not pulling an error but it simply does nothing when attached to the target object that I am trying to activate. this question is probobly really stupid but I am new enough to C# coding. Spare with me please. :slight_smile: Here is my code:

using UnityEngine;
using System.Collections;

public class WaterFlip : MonoBehaviour {
	public float PlayerHeight; 

	// Use this for initialization
	void Start () {

		
	}	

	void Update () {
	
		if (GameObject.Find("FPSController").transform.position.y < PlayerHeight) {
			gameObject.SetActive (true);
		}
	}
}

Thanks,

CaptainChaos

“Making a GameObject inactive will disable every component, turning off any attached renderers, colliders, rigidbodies, scripts, etc… Any scripts that you have attached to the GameObject will no longer have Update() called, for example.”

You’d have to set it active from an outside script or mimic the ‘isactive’ depending on what you want to achieve with it.