[Bug] Duplicated graph instance bug

Forums 💬 FlowCanvas ⚙️ Support [Bug] Duplicated graph instance bug

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12261
    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!

      #12263
      xfdang
      Participant

        We use 3.1.6 in our project.

        #12262
        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!

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