using System.Collections; using System.Collections.Generic; using UnityEngine; public class CrestWater : MonoBehaviour { public GameObject source; public MonoBehaviour CrestShallowWaterSimulation; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { Debug.Log(transform.position.y); if (transform.position.y > 16.7f) { source.SetActive(true); CrestShallowWaterSimulation.enabled = true; } else { source.SetActive(false); CrestShallowWaterSimulation.enabled = false; } } }