Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UI Text Do Not Destroy on Load?

Discussion in 'Scripting' started by Jana1108, Jul 8, 2015.

  1. Jana1108

    Jana1108

    Joined:
    Jun 27, 2015
    Posts:
    215
    How can I make a UI Text object not destroy on load? I added this DontDestroyOnLoad(gameObject); to a script and added that to the labels but it's not working??
     
  2. Garross

    Garross

    Joined:
    Jul 27, 2015
    Posts:
    1
    parent your text to a canvas , and make sure that both the canvas and the text have the don't destroy script :D. If the Ui's parent is destroyed it will be too .