PUN Classic (v1), PUN 2 and Bolt are in maintenance mode. We will support Unity 2022 with PUN 2, but no new features will be added. Of course all your PUN & Bolt projects will continue to work and run with the known performance in the future. For any upcoming or new projects: please switch to Photon Fusion or Quantum.

Animation

If you want to use your animation to process physics or logic, you should enable Always Animate on the Culling Mode of the animator. If you decide you do not want to use the built in Animator support in Bolt you could also just subscribe to state changes and apply the changes to the animator state machine.

For example:

public class MyPlayerController : Bolt.EntityBehaviour<IPlayerState>
{
    private Animator anim;

    private void Start ()
    {
        anim = GetComponent<Animator>();
    }

    public override void Attached()
    {
        BoltConsole.Write("Player Attached");

        state.AddCallback("walking", () => {
            anim.SetBool("walking", state.walking);
        });

        state.AddCallback("dead", () => {
            anim.SetBool("dead", state.dead);
        });
    }
}

To Document Top