Object position changes during transitions in preview

Looks like there are a lot of similar queries in the forum - but not exactly (as best as my searching has concluded).

I have a third-person character, and some animations I want it to play in succession, slightly blended.

  • The transform of the character is (0,0,7.5).
  • I've created a Timeline on an empty gameobject at (0,0,0).
  • I dragged the character (which has an animator) into the Timeline window, and created an Animation Track.
  • I then drag and drop my first animation, called SleepingIdle.

  • So far so good, in preview and play mode the character is sleeping.

  • Next, I drag in my second animation, called StandingUp and snap it beside the first animation.

  • This previews/plays fine too.

  • I blend the two animations.

This is where the troubles begin: when I preview the transition between these two animations, the character snaps over to what seems to be a position of (0,0,0). It seems to snap to (0,0,0) no matter what the Timeline gameobject's position is.

In play mode, the transition works as expected.

Is this a bug?

Here is a demonstration of my problem: 6o7weh

This problem exists in Unity 2020.1.13f1 and 2019.4.12f1.

I tried recreating the problem again... but it seems to be inconsistent.... and weird:
41klg5

Extremely weird.
Can you file a bug with your scene added to it? I'd like to inspect your clips.
If you do so, please give report back the bug number here so I can look at it before it goes through the QA pipeline.


Uploading my bug report now!
Gosh, I didn't realize it was going to upload the whole thing. Do you need all 6.25GB? (Asked while still at 1% complete)

The upload failed - so I tried again without the entire project. I did, however, include the scene file and animation clips. The issue is recreatable with any Synty Studios character (haven't tried other publisher's characters yet, come to think of it).

Awaiting bug number.

I didn't receive an email with a bug report number - should I have?

You should I think.
Do you remember what you put as a title?

Yes, I used the exact same as this thread: "Object position changes during transitions in preview"

1295759
Looks like our QA incoming department has a large backlog. The link for the bug should be generated later.

Sadly, I can't use the scene or controller files without the relative links to the other assets.

You can extract your scene by using Export Package from the right click menu on your scene.
It's not the end of the world if it's picking up all your scripts.

I have responded to you through the bug, you can respond and attach the .unitypackage in the email I think

Sorry - got taken away from gamedev'ing this week. Just catching up now.

I still don't have any emails confirming the submitted bug report... nor can I find it when searching for 1295759 on the issue tracker site.

What I'll do is WeTransfer the exported .unitypackage, and share a link via a DM.

I may have figured it out...
I have a script that is fighting for control over the animator. Confirming now....


I'm wrong. Disabling the competing component "MAnimal" does seem to help with playback issues in play mode, but preview still behaves the same.

The Animator has some code that does pattern matching for Avatars, where even if the path doesn't quite match, it can resolve it. It seems that there's an issue while blending two clips where the position gets reset to zero when you use this.

To avoid issues, you should put your Animator at the root of your character Avatar (in this case Character_Female_Pirate_01(fixedScale)). We may be able to fix this issue, but that pattern matching code will probably cause you other issues in the future.

As for the character falling: this is caused by the RigidBody. You should animate it to isKinematic = true while Timeline is active to avoid this.

We will investigate the issue further to figure out why it's getting reset to zero.


Thank you!


I believe the falling is happening because there is a capsule collider attached to my camera (at zero), so when the position gets changed to zero - it does what it's supposed to do with colliders/rigidbody.

@Malbers , is it possible to use an animator on the character mesh (which is a child) instead of the parent where MAnimal sits? When I switchanged the animator reference (MAnimal>Advanced>References>Animator) it doesn't behave properly.

The MAnimal Component needs to have the Animator on the same hierarchy level, since I use Internally OnAnimatorMove(). and without the Animator, none of the code inside that method will be executed


Actually I had the same issues for a while and it seems that it has something to do when OnAnimatorMove() is used.
So I've created a Fixer Script for that case:
AnimatorMoveTimelineFixer.cs

Which basically gets executed in Edit Mode and restores the built-in RootMotion using OnAnimatorMove.

Is a super weird bug.

So when you are using Timeline add that script to your character.

That script it will be destroyed OnPlayMode, so it does not interfiere with the other Scripts OnAnimatorMove code

/// <summary>
    /// This is used for all the components that use OnAnimator Move... it breaks the Timeline edition
    /// </summary>
    [ExecuteInEditMode]
    public class AnimatorMoveTimelineFixer : MonoBehaviour
    {
        public Animator anim;
        void Start()
        {
            if (Application.isEditor && Application.isPlaying) Destroy(this);
        }

        private void OnAnimatorMove()
        { if (anim!= null)  anim.ApplyBuiltinRootMotion(); }

        private void Reset()
        { anim = GetComponent<Animator>(); }
    }
1 Like