
[ad_1]
Hello im a complete noob so please dont blame me.
So, I’ve this code however I cant discover a becoming reply on how you can test if all the things tagged “Target1” is destroyed. Most of the solutions are both overcomplicated or ,and most actually, im too silly
public Transform teleportTarget;
public GameObject thePlayer;
public Transform[] spawnLocations;
public GameObject[] whatToSpawnPrefab;
public GameObject[] whatToSpawnClone;
void spawnTargets()
{
whatToSpawnClone[0] = Instantiate(whatToSpawnPrefab[0], spawnLocations[0].remodel.place, Quaternion.Euler(0, 180, 0)) as GameObject;
whatToSpawnClone[1] = Instantiate(whatToSpawnPrefab[1], spawnLocations[1].remodel.place, Quaternion.Euler(0, 180, 0)) as GameObject;
whatToSpawnClone[2] = Instantiate(whatToSpawnPrefab[2], spawnLocations[2].remodel.place, Quaternion.Euler(0, 180, 0)) as GameObject;
whatToSpawnClone[3] = Instantiate(whatToSpawnPrefab[3], spawnLocations[3].remodel.place, Quaternion.Euler(0, 180, 0)) as GameObject;
}
personal void TeleportPlayer()
{
thePlayer.remodel.place = teleportTarget.remodel.place;
}
Im simply on the lookout for a approach to test if all GameObjects Tagged “Target1” (in the entire recreation)
are destroyed after which to spawnTargets and TeleportPlayer.
Previously I had the bug, that after they respawned it wasnt checking anymore. It has to test on a regular basis.Because else I get caught, as a result of teleport teleports me on a regular basis. I hope you perceive what I imply
I do know this can be a simple query however im a noob and im sorry for losing your time, nonetheless I hope you may assist me.
[ad_2]