Timeline with Fixedupdate Timing

Hi all!

I’m trying to get feature parity with the Animator’s FixedUpdate timing and AnimatePhysics checkbox using Timelines. AnimatePhysics seems to work but getting the timing to be on FixedUpdate seems like a much more challenging task.

When I’ve tried using graph.Evaluate(Time.fixedDeltaTime) in FixedUpdate I get very strange behavior where physics animates separately from the renderers. Physics pushes my rigidbodies around as if the animation is playing but the rendered objects stay still. This is not the case when I use the same logic in LateUpdate. In the scene view it behaves as if its not moving at all, even when the timeline tab is closed.

You can replicate this by changing the timing in the script in the linked comment from LateUpdate to FixedUpdate.

I’d love to hear from other folks who have bumped into this or who have deeper insight.

Thanks!

Are your physics objects dynamic or kinematic?
Do they have interpolation (or extrapolation) enabled?
Do you animate rigidbody.position or transform.position?

My hunch is that you have interpolation enabled and animate rigidbody.position, or some other way that breaks rigidbody interpolation.

Dynamic physics bodies should be moved with AddForce, and kinematic with MovePosition, while rigidbody.position is for instant teleporting.

What about game view?

Did you play the timeline in playmode? In edit mode there are no fixed updates.

Thanks for following up! I think this is solved!

It turned out I had an animator in my timeline that already had a Runtime Animation Controller set which was causing competing behavior (probably running the timeline in FixedUpdate and then the Animator in Update), hence the desync of physics and rendered objects.

Since you can’t really meaningfully animate Rigidbody components out of the box a lot of that is driven by the animator’s Animate Physics feature. If you have kinematic rigidbodies in your animation it will add linear and angular velocities back into the rigidbody components as inferred from deltas in the keyframes. It is pretty unstable when you’re running it in the Update loop! Hence the need for a custom FixedUpdate timing using manual mode in the Timeline.