Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Object exist or not

Discussion in 'Getting Started' started by skeleton-king, Mar 21, 2015.

  1. skeleton-king

    skeleton-king

    Joined:
    Nov 10, 2014
    Posts:
    63
    How to check if object exist in current screen or not.
    I wana spawn a win screen if no win screen currenlty exists in scene
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    GameObject.Find will return null if it can't find the object.
     
  3. knr_

    knr_

    Joined:
    Nov 17, 2012
    Posts:
    258
    It may be better to not spawn the screen, but have it exist already, just have its active flag set to false. Then simply set it to true when you want it to "exist" and false when you need it to "go away".
     
    theANMATOR2b likes this.