Transition to Same State

NodeCanvas Forums Support Transition to Same State

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9598

    What is the reason for disallowing self-transitions?

    Usually, FSM’s allow self-transitions:

    Especially in combination with the “ANY STATE” node, it can be useful to restart the same node if conditions have been met (again).

    Illustration

    I need the DUMMY node here to prevent a “Trying entering same state” error.

    It works. It’s just not super pretty 😉

    Attachments:
    You must be logged in to view attached files.
    #9604
    Gavalakis
    Keymaster

    Hey,

    I’m very sorry for the late reply. Some things required my attention.

    Yeah, self transitions are not possible right now. It is mostly a GUI representation thing rather than not possible functionality wise. I need to find a way to represent the transitions and still be good looking and definetely readable along with their conditions 🙂

    Indeed you could remove the check in FSM.cs line #99 for allowing entering the same state. It will work (the target state will Finish before Starting again). The problem in this case will be that if the AnyState transition codition is continously true, it will keep entering the target state per frame and that might not be desired. Or is it in your case?

    Cheers!

    Join us on Discord: https://discord.gg/97q2Rjh

    #9603

    Thanks for your reply! It’s not late at all 😐

    The problem in this case will be that if the AnyState transition codition is continously true, it will keep entering the target state per frame

    That could definitely happen, but I think that is a ‘risk’ with “Any State” transitions in general. I would say that’s up to the user, not something NC should try to solve.

    Any State does mean Any State, not Any State Except The One You Came From. 🙂

    #9602
    Gavalakis
    Keymaster

    Hey,

    Alright. I’m convinced 🙂 I will remove the same state check for the next version.
    If people don’t like that behaviour, I could implement it as a setting in the AnyState node, instead of globaly.

    Cheers!

    Join us on Discord: https://discord.gg/97q2Rjh

    #9601
    Async0x42
    Participant

    For reference, the animator in Unity has an option for state transitions ‘Allow transition to self’, personally, I think this would work well on a per-node basis rather than a global setting, with it disabled or enabled by default, whichever would be the most common-use scenario (probably disabled, since there hasn’t been more discussion about this I think?)

    (Screenshot attached)

    Edit: Just a thought, but since it’s disabled right now, changing it globally to enabled by default might cause a bit of grief to people who have a ton of work done in NodeCanvas

    #9600
    Gavalakis
    Keymaster

    Yeah this is what I ment by having this as an option in the AnyState node. 🙂

    Cheers!

    Join us on Discord: https://discord.gg/97q2Rjh

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