Bug: SendEvent doesn't work with instantiated prefabs, sometimes.

FlowCanvas Forums Support Bug: SendEvent doesn't work with instantiated prefabs, sometimes.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2277
    guyboots_thunderbro
    Participant

    I have a FlowScript attached to a prefab that, during the “On Start” event, invokes SendEvent, targeting a child of this prefab.

    When the prefab is instantiated, the “On Start” event is triggered properly, but SendEvent doesn’t work. There’s no logs in the FlowCanvas console indicating an event was sent, and the Custom Event node isn’t triggered. Switching On Start with On Update resolves the situation, but is messy and inefficient.

    #2280
    Gavalakis
    Keymaster

    Hello,

     

    Just to clarify, are you calling a SendEvent from the root gameobject graph, that you are expecting to be “catched” by a graph on the child gameobject? If that is the case, then the problem should be that, when the root graph “Start” is called, the child graph is not yet initialized and as such the event is never catched. One of the changes I am planning for the next version, is to initialize the all graphs before any “Start” event is called. This will effectively fix the issue, if that is indeed your setup.

     

    Let me know.

    Thanks!

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

    #2281
    guyboots_thunderbro
    Participant

    > <span style=”background-color: #fbfbfb; color: #323232; font-family: ‘Open Sans’; font-size: 12px;”>Just to clarify, are you calling a SendEvent from the root gameobject graph, that you are expecting to be “catched” by a graph on the child gameobject?</span>

    Yep!

    > <span style=”background-color: #fbfbfb; color: #323232; font-family: ‘Open Sans’; font-size: 12px;”>If that is the case, then the problem should be that, when the root graph “Start” is called, the child graph is not yet initialized and as such the event is never catched. One of the changes I am planning for the next version, is to initialize the all graphs before any “Start” event is called. This will effectively fix the issue, if that is indeed your setup.</span>

    That sounds great!

    #2292
    Gavalakis
    Keymaster

    Thanks for the clarification!

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

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