Questions about State Machine Behaviour

Hello, in a 2D game I’m making the character needs to first play the animation and only after must be able to shoot or aim. I have tried to use SetActive, but it doesn’t work and I don’t know what else I can try in State Machine Behaviour. Is there any other method? Thanks in advance.

You can set up a basic Finite State Machine, what this is is makes is so your character can only be in state at a time. You define the states you want, usually in an enum, then you create a variable for the current state.

    enum CharacterStates{
    PLAY_ANIMATION,
    FREE_MOVE,
    DIE
    }
    CharacterState state;

You define the states you want and then you can set up a switch statement.

switch(state){
case PLAY_ANIMATION:
//logic
break;
case FREE_MOVE:
//logic
break;
default:
break;
}