Godot Version
Windows Godot 4.2
Question itself:
For a little while now, I’ve been trying to redo my character code for my game into a finite state machine using a method of various nodes and scripts (image for reference) but I’ve been getting stuck because it’s a bit tedious to do so, but I’m now wondering if there’s a way I can possibly dump the nodes and multiple scripts part and just do it all inside my singular player script?
I know a state machine is used to separate each movement from each other, so the option to only call one movement at a time is opened up, and that its useful for more organized coding, but couldn’t that all be done on one script? if it is, how would that be done?
Currently, my non-FSM player code is a script where each movement is in its own function (i.e., “defaultJump()” and “defaultMove()”) and all of them are called in _physics_process(delta). (Here’s an image of it for better reference)
Could I possibly keep my current code style perhaps, but implement a form of state machine inside that same code where only 1 of these functions is called at once?
Thanks in advance!