So I am making this simple puzzle game were you control two squares that have to get to two different squares in order to move to the next level. Ok, all that works fine. Except the collision detecting sometimes. I’ve set it up like this. Both squares run the same script for movement. The blue square has a script that only sets a bool to true if it is colliding with the blue “goal” (if that makes sense) and the green square runs a second script that sets a bool to true if it is touching the green “goal” and if both the blue and green bools are true it moves to the next level using:
SceneManager.LoadScene (SceneManager.GetActiveScene ().buildIndex + 1);
It works for the first levels but when I wanted to add another level, it doesn’t detect the collision with the “goals” anymore and cannot move to next level, even though I’ve checked a billion times to make sure it is in the build settings. Why doesn’t this work if it works for the first three levels?
Because you haven’t correctly assigned the green and blue goal tags on level 4?