Open MrGreenTea opened 7 years ago
Thank you a lot! Basically fsm is never expecting to be removed from scene tree (only states and transitions are prepared for this) But you have couple options to make it work, the fast one: If you uncheck "only active state on the scene" it in ~both~ parent fsm it will work fine.
If you need this option you still can! Second way:
make setup similar to how it's on this screen:
(notice script as well as inspector setup of sub-fsm (update mode, manual init))
Thanks a lot, the second way worked very well. Could be something to look into, as it's a bit unintuitive.
I think in next update I will make 'only active state on the scene' off by default. Since it has also other implications that user can not be aware of and this option don't need to be on at all most of the time anyway. This option is there mainly because it can increase performance of your program (like remove from the scene tree rays/areas that are not needed in different states (thats how I'm using it)) Or to have for example different sprites in different states and not code sprite changes or something.
But I think it's there more for people who are aware of what FSM will do if you check it (or at least they will think about that for a second before checking).
@MrGreenTea also one more thing, each state have it's own scene file. It's there for user comfort, you can use it if you want (mean by putting all the child nodes of first level SECOND state inside SECOND scene) (just an info)
Actually I will open it for now. It should be possible to fix this concrete case.
I am trying to create a menu with this plugin and it works really good. But when I try to create a sub-menu, changing states does not work. I have created a minimal example of this for you to check out: FSM_testing.tar.gz If you need more info, I'd be glad to assist.