Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Mar 10, 2019 at 02:02 PM by Lapraniteon for the following reason:

Problem solved.

avatar image
0
Question by Lapraniteon · Mar 03, 2019 at 11:02 AM · unity 5uiscenecanvasmenu

UI doesn't render after scene reload.

So this is a legitimate concern. I have 2 seperate scripts in my game: 1 for a pause menu, and 1 that manages the whole main menu and level select screen. So the main menu works perfectly and all. I should note that the main menu and level select screen are two separate canvasses and that switching between the menu screen and the level select screen just sets one of the two canvasses active or inactive. Now, when I go into my actual game and wanna quit back to the main menu via the pause menu, none of the UI elements show up after I reload my scene. But when I look into the hierarchy while in play mode both canvasses show up active. After I turn off play mode, both canvasses reappear. Anyone know what's going on here? I should also probably note that on setting active of the main menu canvas I have some animations that play (that fades in the text and buttons and so on). I tried exporting the game to see if this was an editor-only issue but this was not the case. These are my scripts:
Main Menu:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.SceneManagement;
 
 public class menuScript : MonoBehaviour {
     
     private GameObject mainMenu;
     private GameObject levelSelectScreen;
     
     void Start () {
         mainMenu = GameObject.Find("MainMenu");
         levelSelectScreen = GameObject.Find("LevelSelect");
         mainMenu.SetActive(true);
         levelSelectScreen.SetActive(false);
     }
 
     public void startGame () {
         SceneManager.LoadScene("stages");
         }
         
     public void QuitGame () {
         Application.Quit ();
     }
     
     public void levelSelect () {
         mainMenu.SetActive(false);
         levelSelectScreen.SetActive(true);
     }
     
     public void goBack () {
         mainMenu.SetActive(true);
         levelSelectScreen.SetActive(false);
     }
     
     public void world1 () {
         mainMenu.SetActive(true);
         SceneManager.LoadScene("stages");
     }
     
     public void world2 () {
         mainMenu.SetActive(true);
         SceneManager.LoadScene("stages2");
     }
 }

All these public voids are being called by UI buttons through OnClick.

Pause Menu Script:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.SceneManagement;
 
 public class pause : MonoBehaviour {
 
     private GameObject pauseMenu;
 
     void Start () {
         pauseMenu = GameObject.Find("PauseMenu");
     }
     
     public void resumeGame () {
         GameObject.Find("Player").GetComponent<player>().gamePaused = false;
         Time.timeScale = 1.0f;
         pauseMenu.SetActive(false);
     }
     
     public void quitGame () {
         Application.Quit ();
     }
     
     public void backToTitle () {
         SceneManager.LoadScene("title");
     }
 }

Again these are being called by UI buttons.
Does anyone know what's going on here? Am I doing something wrong? I don't get any compiling errors or exceptions. And I can't seem to find the problem. Does it have anything to do with setting canvasses active or inactive? Or the fact that there are two canvasses? Please let me know. I am using Unity 5.6.4p2

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

259 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Pause menu works on all scenes but one... 1 Answer

How would you go about linking to projects together, and adding a menu? 1 Answer

Unity 5 canvas animation laggs, why? 0 Answers

How to make a Panel (Or Scrollbar) Appear on Button Click 0 Answers

Last frame of last scene not cleared? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges