This document is about: FUSION 2-SHARED
SWITCH TO

Animation

Overview

Animation can be networked with the NetworkMecanimAnimator component.

The NetworkMecanimAnimator synchronizes the state and values of the parameters held by an associated Unity mecanim Animator component

Usage

Any controller code should apply inputs to the State Authority, and not to Proxies. This Automatically will be the case if you make use of Fusion's input system.

C#

void FixedUpdateNetwork()
{
    // FixedUpdateNetwork is only executed on the StateAuthority

     // Apply inputs to Animator
}

SetTrigger()

The pass-through NetworkMecanimAnimator.SetTrigger() methods should used instead of Animator.SetTrigger() calls, as triggers are transient and it is possible for the backing bool to reset to false before NetworkMecanimAnimator captures the values of the Animator component. There is also a passThroughOnInputAuthority option for NetworkMecanimAnimator.SetTrigger(), which immediately passes through to Animator.SetTrigger() on the Input Authority, as a convenience.

Back to top