Search Issue Tracker

Won't Fix

Votes

0

Found in

2021.3.32f1

2022.3.15f1

2023.2.2f1

2023.3.0a15

Issue ID

UUM-57349

Regression

No

Destroying AnimationOutput writes to the animator default values, breaking certain workflows

--

-

Steps to reproduce:
# Open the attached project: "AnimationOutput_Repro"
# 2. Open "DefaultValues-TestScene.unity" Scene
# Enter Play mode
# Note the Continuous motion of the object and its location
# Enable the "Custom Graph" object
# Let the new animation play a couple of loops
# Disable the "Custom Graph" object

Expected results: Continuous motion returns, as if the custom object was never enabled
Actual results: Depending on the error introduced, which depends on when in the loop the object was disabled, the motion is now skipping and non-continuous. Different to the state before the object was enabled

{_}Explanation{_}:

The "Custom Graph" object creates a playable graph during _OnEnable_ and destroys is during {_}OnDisable{_}. The playable graph contains a animation output that plays an animation clip using the animator in the scene. 

When the object is disabled, its graph is destroyed and the animation output is also destroyed. The destroy operation changes the animator's default values.

_How to reproduce with Timeline:_

Steps to reproduce:
1. Open the attached user's project "Animator-DefaultValue-Issues.zip"
2. Open "DefaultValues-TestScene.unity" Scene
3. Enter Play Mode
4. Note the Continuous motion of the object, no skipping or jumping
5. Enable the "Timeline" GameObject
6. Let the new animation play a couple of loops
7. Disable the "Timeline" GameObject

Expected results: Continuous motion returns, as if the Timeline was never enabled
Actual results: Depending on the error introduced, which depends on when in the loop the Timeline was disabled, the motion is now skipping and non-continuous. Different to the state before the Timeline was enabled

Reproducible with: 2021.3.32f1, 2022.3.14f1, 2023.2.1f1, 2023.3.0a15

Testing environment: Windows 10
Not reproducible on: No other environment tested

Notes:
-When a Timeline is toggled on and then off for an animtor, the animator's default values are affected. If an animation was relying on expected default values then that animation will no longer work as expected.
-A key part of the workflow is the use of "Write Default Values On Disable" on the animator and "Write Default Values" in each Animator State
-The customer is well aware of how "Write Default Values On Disable" and "Keep Animator State on Disable" work. They wish to use only "Write Default Values On Disable : true" as this functionality generates the simplest workflow for them when they're driving and pooling animators
-Videos attached explaining the issue in more detail "DefaultValue_Explainer.mp4" and "DefaultValue_Addition.mp4"

  1. Resolution Note:

    Thank you for bringing this issue to our attention. Unfortunately, after careful consideration, we will not be fixing your issue at this time.

    We experimented with writing the default values whenever a PlayableGraph (Timeline) is bound to/unbound from a target Animator.
    There is a high risk and known issues in changing this behaviour. Since there is an acceptable workaround to this issue, we are closing this bug report as won’t fix.

    Workaround:
    Manually call Animator.WriteDefaultValues whenever you want to enable/disable the timeline.
    You could do it through another script that would manage the timeline’s lifecycle.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.