I am trying to to test with an if statement for when a gameObject is between two different x locations using the following code:
if(spiralY.transform.position.x >= -16 && spiralY.transform.position.x <= 19){ renderer.enabled = true; print("location" + spiralY.transform.position.x); }
I am getting a NullReferenceException error. Is there another way to test the location of a gameObject?