How do you combine Animator and fsms

So, I have implemented a basic state machine for my character. Now I want to animate the sprite character and I can think of three ways of doing it.

  1. I replicate the states and transitions in the animator controller. I assign a bool or trigger condition for the transitions that I change from my fsm state scripts. I.e. The fsm is in move state, the player releases all keys so I change the bool “to_Idle” ( that is a condition of the transition from move to idle states in unity animator ) from my move state script. The animator controller condition “to_Idle” is now true so it transitions to Idle state.
    While this works it means that I have to work two times and any change in my fsm states has to be replicated carefully in the Animator controller.

  2. I replicate only the states in the animator controller and have them all transition from any. This way only my fsm takes care of which states a state con transition to. I tested this with few states and it works but I see that is not how the animator was intended to be used.

  3. Using state behaviours. I didn’t try this, but would it be posible to use behaviours scritps to manage the logic of your states ?

How do you do it ?

Your first point is the most commonly implemented FSM animator. If you decide to go with this path I would draw out all the states before hand, and keep a document handy to keep track of any changes you have made.

I have not seen the second point done very often, but it may lead to some unexpected behavior.

You can change states in a Monobehavior script (AnimatorStateMachine), but then that just cuts out the Animator entirely.

Here are some useful video tutorials using Playmaker

Otherwise - idk.