Using FSM for UI flow: Back button trouble

Forums 💬 NodeCanvas 🗨️ General Discussion Using FSM for UI flow: Back button trouble

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13826
    modernalchemists
    Participant

      Hi!

      I want to use a FSM for UI flow: Each screen is a state.
      Now I also need a back button functionality.
      Currently, I got a BBVar (bool) wantsBack.
      Each state connects back to the “calling state” and checks if wantsBack is true.

      So far so good?

      My problem is:
      As soon as I enter the “back state”, since wantsBack is still true, it steps back again and again and again.
      I have to set wantsBack to false in every OnEnter of every state.

      Is this the suggested solution?

      If I use Unity states (Mechanim), there’s the concept of a Trigger, which automatically resets, once consumed.
      Is there something like this in Node Canvas or am I missing something?

      Thanks!

      #13828
      modernalchemists
      Participant

        Short update:
        One current solution would be to use this transition code:

        Please note that the string info part isn’t working yet. It always prints “Trigger:”, even if the name is empty.

        #13827
        Gavalakis
        Keymaster

          Hello,

          I like your solution as well as the condition 🙂 I think I will include this in the next version as well. The name property by the way, can be made easier, since BBParameter already overrides ToString(), thus to return a nice label automatically 🙂

          With that said though, I think that if you want to actually check if a button is clicked, then maybe using the “UGUI/Button Clicked” condition could be a better option depending on your use case.

          Thanks!

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.