FSM state checking its exit transition condition before executing its action?

NodeCanvas Forums Support FSM state checking its exit transition condition before executing its action?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14133
    buddyhunter1
    Participant

    Hello,
    I have a FSM with a state where I’m performing a single custom action task, then waiting for a custom condition task to return false (checking continuously). For some reason, the OnCheck() method for the condition is firing before the OnExecute() method for the action. This doesn’t happen every single time – it seems to have a 50/50 probability of happening. This becomes problematic for any states where its exit condition would be one value if it gets checked first, or another value if its action executes first. I would expect a state’s first action to always execute before any of its exit conditions are checked. Is this a bug?

    Here’s my custom tasks. I’m aware that for this specific action I could just wait for the state to complete rather than continuously checking the condition, but this is just an example of the issue.

    Here’s part of my editor log showing the Debug.Log from the condition logging before the one from the action:

    Here’s a picture of my FSM, as well as the state and transition in question.

    FSM

    State

    Connection

    I’m using Unity v2018.3.3f1 and NodeCanvas Framework v2.91.

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

    Hello,

    Hmm. Code wise, “OnExecute” is always called before any transition condition “OnCheck” and I’ve just double checked for any possible bugs. I think the problem might lie with the event registration/unregistration here. Unfortunately I was not able to replicating the problem though :(.
    Would it be possible for you to please send me a small replication project showcasing this problem you are facing to (support_AT_paradoxnotion.com) ?

    Thank you in advance.

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

    #14146
    buddyhunter1
    Participant

    Hmm, yup, it does seem to be the event subscription + callback that was causing this to happen. I just emailed you a Unity project with a reproduction anyways!

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