[SerializeField] Boss Firstboss;
[SerializeField] UnityEvent BossEvent;
[SerializeField] GameObject SecondBoss;
public void NextSpawn()
{
if (Firstboss.FirstBossDied == true)
{
BossEvent?.Invoke();
}
}
public void SpawnSecondBoss()
{
Instantiate(SecondBoss, new Vector3(0, 0, -15), Quaternion.identity);
Debug.Log("Activate");
}```
Ok this seems to work when i press a button on the canvas. But i want this to invoke the moment that FirstBossDied turn true. But it didnt, is there anything i did wrong?