Error cs0029: Cannot implicitly convert type `void' to `bool'

I was coding and suddenly this error popped up:

Error cs0029: Cannot implicitly convert type void' to bool’

I checked over my code but I couldn’t find anything wrong with it (Its just three lines and a comment) and I realized I needed help from the pros. So please help me figure out what is wrong.

Here is the code:

void Update() {


		//yield return new WaitForSeconds(5);
		transform.position = new Vector3(Random.Range (-35,35), 2, Random.Range (-55,17));

Thanks For Reading This,


“SetActive” is a method to set the object active. That method doesn’t return any value. Yet you put it in an if statement which expects a boolean value. Since SetActive has the return type “void” (which simply means “nothing”) you can’t put it in an “if” statement.

If you want to check if the object is active or not use activeSelf.