Animator.Play/Animator.Crossfade Issues!

We are using a cutscene editor within Unity to build cutscenes.

One major issue we have encountered so far is the ability to scrub the transition periods between animations without the use of recording (using Animator.StartRecord() of course). For example, if we lay two animations on the timeline and we scrub past the end of the first animation, we would like to scrub the transition time between when the first animation ended and the beginning of the second animation.

In addition to this, we found it particularly challenging to overlap two or animations and have the Animator.Crossfade function transition between them. Instead, what we experienced was a jump from the first animation to the second rather than a smooth transition. This is due to the fact that the Crossfade function doesn’t hold the first animation at a frame we specified while crossfading with the next animation on the timeline. We did notice that Unity was creating it’s own transition between each animation when calling the Animator.Crossfade function, however, it isn’t accessible to us programatically.

To rectify these issues we tried various methods:

Calling Animator.Play(stateName, layerIndex, normalizedTime) and setting the Animator’s speed to zero.
Using this method we can scrub an animation perfectly, however this technique ignores the transitions that a user would normally see during playback (i.e. the animations “pop” between events). This makes things like doing lip syncing impossible.

Animator.Crossfade is of little help because we don’t have access to the internal transitions that are being created behind the scenes.

Blend trees: these also don’t allow us to hold an arbitrary frame and crossfade(or blend) into the next animation.

The closest we have come to solving these issues is programmatically generating and triggering transitions then recording the playback. While this method worked well early on in the development process, in practice it didn’t perform as we expected. The first problem we encountered was a gradual degradation of performance within the Unity editor. The more our animators worked with it the more latency they experienced until finally the editor became unresponsive altogether. This method also creates challenges to the animators’ workflow because everytime an animation is added, they have to restart the game in order to make a new recording so that the most recently added animation will be included in the playback also, since we don’t have access to the buffer holding the playback data we cannot save it or provide the optimizations neccessary to eliminate the memory leak.

Specifically, we are looking for guidance on how to solve these issues:

a) How do we scrub the transition periods between animations?
b) How do we hold an arbitrary frame and transition from that frame to the next state?
c) How can we access the buffer being used to store the animation data?
d) How can we access the transition that the Crossfade function creates internally?
e) Will these features be included in the next update to Mecanim?
f) How can we acheive our objectives until these features are included in Mecanim?

Thanks in Advance!

a) you don’t
b) you don’t
c) you can’t
d) you can’t
e) you never know
f) use Legacy :slight_smile:

1 Like

Thanks for the sanity check. I’ve been dealing with timing related issues for a hot minute. Glad to see I’m not the only one being driven mad by the lack of these features.

Yes, It seems Mecanim may be great for character animation but for simple sprite animation it is frustrating.