Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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,113
    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:
    125
    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,113
    Got it, you know your timeline. Using it for gameplay?