Inspiaaa / UnityHFSM

A simple yet powerful class-based hierarchical finite state machine for Unity
MIT License
1.14k stars 125 forks source link

How can I see the current state of the state machine for debugging? #15

Closed wilg closed 10 months ago

wilg commented 2 years ago

I was hoping for a method that would output a string representing the nested state such as Patrol.Move.SearchForPOI?

leehiroshi commented 1 year ago

Hi,do you find a solution to this?

Monsoonexe commented 1 year ago

Yes. I used the fsm.ActiveState property.

On Fri, Dec 23, 2022, 4:13 AM leehiroshi @.***> wrote:

Hi,do you find a solution to this?

— Reply to this email directly, view it on GitHub https://github.com/Inspiaaa/UnityHFSM/issues/15#issuecomment-1363904099, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNKVBJIZJEUZB5KKWTBPTTWOWJOFANCNFSM55XN3BOQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

wilg commented 1 year ago

I switched to https://github.com/ashblue/fluid-behavior-tree

Inspiaaa commented 1 year ago

Hi @wilg, apologies for the late reply. I know you have moved on to another library, but for closure let me answer the original question all the same. In the current version there is no way to get a string representation of the active nested state. I agree that it would be a useful feature and for this reason I have implemented it in the release branch, which will finally lead to the 1.10 release. If you find yourself coming back to UnityHFSM, please take a look at the Changelog.md and the TestActiveHierarchyPath.cs files for usage examples.

Inspiaaa commented 10 months ago

This feature is now part of the recent 2.0 release.