Search Unity

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:
    11
    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,516
    Hard to say, as it very much depends on the what your global-to-all-scenes controller class is doing.