Figure: Diagnostic workflow: Manage playback/stop → Own graphs/resources → Inspect final state
Figure: Diagnostic workflow: Manage playback/stop → Own graphs/resources → Inspect final state

Cause and mechanism

PlayableBehaviour runs custom behavior as part of a Playable or Timeline. If it changes a value and never restores it, the last visible state can remain after playback stops. Investigate leftover state separately from a memory leak, where unwanted memory stays allocated. A reference alone does not prove a permanent Unity-object leak.

Check and correct the setup

  1. Capture original state and restore it at the intended stop or graph teardown boundary.
    Release / Dispose
    Release / Dispose
  2. OnBehaviourPause can also occur during pauses/evaluation. Blend overlapping clips centrally in a mixer instead of letting each restore competing values.
    Release / Dispose
    Release / Dispose
  3. Unsubscribe events and dispose owned resources. Test residual values and memory growth independently.
    Release / Dispose
    Release / Dispose

Limits and verification

Test play, pause, seek, stop, loops, and scene transitions. Decide whether stopping should restore the original value or retain the final value.

A focused diagnostic setup

Use one custom playable changing a value/color and record residual state separately from resources increasing across repeats. Define the intended final state first.

Test in this order

  1. Log relevant play, pause, stop, seek and graph-destruction callbacks.
    Release / Dispose
    Release / Dispose
  2. Resolve overlapping clips in a mixer instead of letting clips restore competing values independently.
    Release / Dispose
    Release / Dispose
  3. List subscriptions/owned resources and compare repeated playback and scene-exit retention.
    Release / Dispose
    Release / Dispose

Interpret the result

Stable resource counts with residual values suggest state restoration/order. Correct visuals with increasing resources suggest cleanup problems. Pause is not identical to final destruction.

Related explanations

References