Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

DontDestroyOnLoad() seems to interfere with signals

Discussion in 'Timeline' started by lord_goldemort, Jun 11, 2020.

  1. lord_goldemort

    lord_goldemort

    Joined:
    Oct 5, 2017
    Posts:
    7
    I have a global-to-all-scenes controller class that has DontDestroyOnLoad() called in its Awake.

    I have 3 scenes

    A - a bootstrap scene with a splash that preloads static data and does one-time initialisation.
    B - a cutscene
    C - a second cutscene

    A loads B after it's done its init. B and C have a timeline directors. B's timeline has a signal near the end which calls a method on the controller object to load C.

    If I load scene B and run it, then C loads as intended.
    I I load scene A and run it, B loads (but not through timeline), but the signal at the end of B never fires (I breakpointed it, and it doesn't get hit).

    Is this a bug?
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,309
    Hard to say, as it very much depends on the what your global-to-all-scenes controller class is doing.
     
unityunity