Hi, I have a problem related to async initialization. I’ve created a custom node that clones a GameObject and sends it as an output. Soon after that, I’m supposed to call an event on the cloned object. The problem is that, for performance reasons, I need to set the “First Activation” property of my FlowScript controllers to “Async” and, because of that, when the event is triggered, the cloned object hasn’t initialized yet and the event never reaches the target.
I have included a screenshot showing the relationship between the custom node and the event node.
Is there a way of detecting when the async initialization is finished so I can trigger the node’s output at the right time? (Clone Game Piece is a custom node that is already capable of delaying the outflow, I just need a way of registering a callback that will call it at the right time).
There is a bool property called “initialized” in GraphOwner, which will be true only after initialized (both in async and not async). On the next version there will also be an even (which has been requested before) since it will be easier to use than checking the bool property.
Hi Gavalakis, thank you for your prompt reply. For some reason, checking the initialized property isn’t working, it seems to be something else. I’ll keep investigating to see if I can find more clues on it.
I found something that might be useful. I’ve added some breakpoints inside FlowCanvas to check up to what point the flow was being executed. What I discovered is that the Send Event node is being triggered but, inside Graph.SendEvent(), router is set to null so router.InvokeCustomEvent() isn’t called. Maybe I’m doing something wrong here?
Hi, sorry for bumping the thread, any insights on what might be causing it? We are getting closer to our first release date and this issue is causing performance problems that might become prohibitive on our side.