error CS0029: Cannot implicitly convert type 'void' to 'bool',Error CS0029: Cannot implicitly convert type 'void' to 'bool'

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Llave : MonoBehaviour
{
public GameObject objeto;
public GameObject objeto2;

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
if (objeto.SetActive(false))
  {
    objeto2.SetActive(true);
  }
}

}

you’ve put “objeto.SetActive(false)” inside an if statement, you can’t put that there, what are you trying to do?

You can use a command SetActive() in an if statements… instead try using ActiveInHeirarchy or ActiveSelf

I want that when one object disappears, another one appears

@Druder try this

void Update()
    {
        if(!object1.activeInHierarchy)
            object2.SetActive(true);
    }