Closed Wumuuu closed 7 months ago
You can't transition from one enum type to another within the same StateMachine. You're trying to transition from a MoveState to a JumpState, but moveFsm was defined as a StateMachine<PlayerStates, MoveStates, Events>, with the second T parameter, MoveStates, showing that moveFsm will only allow transitions between MoveStates. The first T there, PlayerStates, is only applicable if you're nesting the state machines.
See on the line fsm.AddState(PlayerStates.MOVE, moveFsm);
They're adding moveFsm to fsm as a nested state machine. This is possible because moveFsm had \
Use an example from the wik.
I'm new to coding,I only know a compromise that
fsm.AddTransition(PlayerStates.MOVE,PlayerStates.JUMP)
and thenjumpFsm.SetStartState(JumpStates.FALL)
.