Good Evening,
I was wondering if it’s possible delete the object with the same name,I’ve found this solution but it works with tag.
public void DestroyAllOther(){
GameObject[] others = GameObject.FindGameObjectsWithTag("Piatta"); //Get array of
//all possible objects with a given tag.
foreach (GameObject go in others){ //Get all of those objects so we can check them..
//As long as the gameObject we're checking isn't ours..
Destroy(go);
}
}
Well I would delete the previous stage and create a new one.The first time it works the second they are overlaid so I need by clicking a button to remove the previous gameobjects
Are they always coming in stages (ie: groups)?
If so, you could make a list of each game object in the group when it’s created, and then it’s available for you when you want to remove (them).
They came from different arrays,like Enemies ,Platforms etc but I don’t want to remove them from the list because I would a complete random game where all the pieces of the level are mixed together
Well there is another solution.
1)I create a first panel with a button where by clicking it I delete the objects
2)Then a second panel appears and I instantiate the scene.I love unity you can find always a smart solution