Thank you very much. I do use the state machine in a way. I was just wondering if it’s common practice to move the “states” into their own nodes—along with the logic and the animations/sprites.
In most tutorials, all of that is packed into the player script, and I personally find that it gets out of hand pretty quickly when you’re developing over several months. With modular animations and logic, I can more easily add new moves without the player script exploding.
There are multiple ways how you can approach designing your State Machine, there is no “one solution fits all”. Just to name a few most popular ones:
You can have states as enums within the same script.
You can have states as Resources with the state logic delegated to each Resource script separately.
You can have states as Nodes and rip the additional benefits of being able to see them easily in the scene tree.
Here’s an interesting discussion about Resource vs Node based State Machines.
Here’s another discussion about a completely different approach that does not use states at all, although this idea is less refined than a traditional State Machine yet.
I’ll let you draw your own conclusions.
EDIT:
I forgot, there are also State Charts, worth considering: