[Bug] Duplicated graph instance bug

FlowCanvas Forums Support [Bug] Duplicated graph instance bug

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3037
    xfdang
    Participant

    Hi there, just found a bug in our project, if you set the [FirstActivation] attribute to [OnEnable] and call FlowScriptController.StartBehaviour() during Awake(), you will get two duplicated graph instances, one in the GetInstance() and one in Initialize(). Both instances will react to the events you sent via flowscript controller, like a single SHOOT evt will spawn two bullets. It can be fixed by call Initialize() in the beginning of GraphOwner.StartBehaviour().

    Hope it helps!

    #3038
    xfdang
    Participant

    We use 3.1.6 in our project.

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

    Hello there,

    Hmm. Why do you manually call StartGraph in Awake since the graph is going to be automatically started anyway since FirstActivation is set OnEnable? If you don’t want to auto start the graph, you can set FirstActivation to DoNothing. 🙂

    Your fix looks correct by the way in case you have to call StartGraph manually.

    Let me know.
    Thanks!

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

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