Question by
thanatoubios · May 21, 2017 at 02:49 AM ·
scene-loadingscene load
Scene Manager worked once but not twice
I've been having a problem with a game i'm making. Its based on the UFO game, except when the player count reaches twelve he touches the warp pad in the center and is moved to the next scene. It works when moving from the base scene to "_Second Room", but won't move from the second to third room. I have all 3 scenes in the build, and the code is the exact same between the two rooms. I'm not sure why it's only working in one instance but not the other.
void OnTriggerEnter2D(Collider2D other) {
if (count == 12)
{
other.gameObject.SetActive(false);
playerScript.SetText("");
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex+1);
playerScript.resetCount();
gameObject.SetActive(false);
}
}
Comment
It sets the text to blank. It doesn't set the game object to false i don't think, however.
Your answer
