Bug? Root Motion with cull completely not possible anymore since Unity 5.4?

In our server app I’m applying root motion (by using animator.rootPosition) inside OnAnimatorMove, which worked great with unity 5.3, but after upgrading to unity 5.4 this doesn’t work anymore. When changing the animator culling mode to always animate it’s working fine, but requires way too much performance.

The strange thing is that ApplyOnAnimatorMove is called not matter what culling mode is used, but it seems the code inside is only getting executed if alwaysanimate is selected.

Is this intended?

After a little testing it seems the code inside OnAnimatorMove gets executed, but animator.rootPosition doesn’t receive any updates if CullCompletely is active, which makes it impossible to apply root motion.

A word from an unity dev would be great, as this change seems to be undocumented. :frowning:

this is not a know issue, could you please log a bug.

OnAnimatorMove is always called because this is how you move you’re object around which have a direct impact on culling state, the culling is done right after this callback.

I have the same problem and filed a bug report some time ago (Case 868744). As a workaround it’s possible to set the culling mode to CullUpdateTransforms (“The statemachine and root motion will always be evaluated.” - Scripting Reference). There will still be a minor performance impact, even when running the application in batchmode, but at least rootPosition gets updated.

@Mecanim-Dev The question is if the animator.rootPosition value is meant to be updated when AnimatorCullingMode.CullCompletely is active. Maybe you can shed some light on this, unfortunately the documentation doesn’t make it clear enough, it just states that the “Animation is completely disabled”, but does this also include the evaluation of root motion AND the related variables (e.g. rootPositon)?

CullUpdateTransforms is the mode you’re supposed to use if you want root motion to be updated offscreen.
CullCompletely updating root motion of objects off screen is not the expected behaviour. I’m fairly certain we fixed a bug around 5.5 about this.