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

[Solved] When instantiating a game object, what MonoBehavior is called?

Discussion in 'Scripting' started by asperatology, May 31, 2015.

  1. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
    It's the opposite equivalent of MonoBehavior.OnDestroy(). When the game object is created, it should trigger an On...() method in MonoBehavior.

    What method is that? Thanks in advance.
     
  2. Duugu

    Duugu

    Joined:
    May 23, 2015
    Posts:
    241
  3. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981
    Ah, so it's not an On...() method. Thanks!
     
  4. Emre_U

    Emre_U

    Joined:
    Jan 27, 2015
    Posts:
    49
    Also U might be looking for OnEnabled() . Awake is called too ofc.
     
  5. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
  6. asperatology

    asperatology

    Joined:
    Mar 10, 2015
    Posts:
    981