// Update is called once per frame void Update() { if (visibilityManager.TestVisibility(transform.position) != -1) { meshrenderer.material = detectedMaterial; Debug.Log("DETECTED"); } else { meshrenderer.material = defaultMaterial; } }