Hi All,
In relation to the ball breaker game when Rick is finding the object type - there is another way which worked for me too. You can use transform.childcount
, which can be used my attaching it to your ‘Blocks’ group and simply when the number of blocks in there reach 0, the code loads the next scene.
using UnityEngine;
using UnityEngine.SceneManagement;
public class ProgressionScript : MonoBehaviour
{
int nextLevel;
int numOfBlocks;
private void Start()
{
int current_scene = SceneManager.GetActiveScene().buildIndex;
nextLevel = current_scene + 1;
}
private void Update()
{
numOfBlocks = transform.childCount;
if (numOfBlocks == 0)
{
SceneManager.LoadScene(nextLevel);
}
}
}