[BUG] FSM error when using DestroyGameObject ActionTask.

NodeCanvas Forums Support [BUG] FSM error when using DestroyGameObject ActionTask.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #14888
    guyboots_thunderbro
    Participant

    This exception happens when using Destroy GameObject on the current agent:

    At the line in the stack trace, currentState is null. It becomes null after FSM.cs:84, currentState.Update(). FSM.cs:76 does a null check, but it’s too early, or maybe there needs to be another?

    Using NodeCanvas 3.0.5. Unity 2019.3.10f.

    #14889
    Gavalakis
    Keymaster

    Hello,

    Just to clarify, is the Destroy GameObject call happening from within the update of the FSM itself, or from some other part of your code?

    Thanks.

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

    #14895
    guyboots_thunderbro
    Participant

    > Just to clarify, is the Destroy GameObject call happening from within the update of the FSM itself, or from some other part of your code?

    Using the Action Task Destroy GameObject.

    #14899
    guyboots_thunderbro
    Participant

    I’ve attached a screenshot.

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

    Hello,

    Yeah, this is an edge case because the FSM is destroyed from within it’s own update. Here is quick fix though. Please open up FSM.cs and completely change the method named ‘OnGraphUpdate’ with the following code:

    Let me know if that quickfix works for you.
    Thanks 🙂

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

    #14918
    guyboots_thunderbro
    Participant

    I have identical changes here locally, so can confirm this works.

    #14928
    Gavalakis
    Keymaster

    Great.
    Thanks for confirming and I am glad the change was the same 🙂

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

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