Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Bug timeline activation tracks lets onenable fire up

Discussion in 'Timeline' started by laurentlavigne, Jun 21, 2023.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,473
    upload_2023-6-20_17-21-48.png

    in this config the objects shouldn't fire up until the activation block is reached
    but that's not the case, all OnEnable are fired up on first frame.
    it shouldn't be the case because PlayOnAwake is toggled on and Awake fires up before OnEnable.
     
  2. Yuchen_Chang

    Yuchen_Chang

    Joined:
    Apr 24, 2020
    Posts:
    140
    The reason is, "Play On Awake" doesn't mean "Evaluate On Awake". It just hit Play() for you on Awake (you will notice that
    playableDirector.playableGraph.isValid()
    returns true), but the evaluation is still between Update() and LateUpdate().
    To resolve this, Evaluate() manually on Awake(), or just disable those GameObjects in your scene at edit mode.
     
    laurentlavigne likes this.
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,473
    Got it, you know your timeline. Using it for gameplay?