Quantcast
Channel: Questions in topic: "level-design"
Viewing all articles
Browse latest Browse all 205

transform.childCount not working as intended

$
0
0
I am building my first game with unity, a simple break out game.i am intending that when the level has no children it moves to the next level.but it doesn't seem to work.in the code I put this in the update methode. else if (_currentLevel != null && _currentLevel.transform.childCount == 0) { SwitchState(State.LEVELCOMPLETED); } break; which call this code case State.LEVELCOMPLETED: Destroy(_currentBall); Destroy(_currentLevel); Level++; PanelLevelCompleted.SetActive(true); SwitchState(State.LOADLEVEL, 1.0f); break; but it doesn't even get into the first condition although in the editor i can see there's no Childrens. PS:Sorry if it's not clear if any more details are needed I will add them.

Viewing all articles
Browse latest Browse all 205

Trending Articles