AsyncLoad option itself is very good to instantiate / initialize graph owner objects even without pooling sometimes since most initialization is happening on a separate thread.
As for typical pooling, you can pre-instantiate all your graph owner objects at the start of the game/scene so that they all initialize at that time. Remember to set the “On Enable” parameter on the graph owner inspector to “Do Nothing” so that the graph owner does not “Start Behaviour” automatically. Then when the time comes that you need that pre-instantiated graph owner, you can simply call owner.StartBehaviour() from code.
The relationship between AsyncLoad, activeInHierarchy, and pooling, is because some people prefer to instantiate the graph owner objects (with AsyncLoad enabled ) and immediately deactivate them instead. Then activate them when they are needed in the game. This will result in the same thing as above, but I recommend using the first way described above instead.
Thanks for the tips! When I tried to use the async option it failed miserably, but I assume that is because I’m not waiting for the background thread to finish. Do you have an example that shows how to use this option?
And to be clear, with the way you suggest to implement pooling, I don’t actually need to use asyncload? I am pre-creating about 100 objects so I figured async would help speed up that initial step.
Async Load would still help like you said to help in the initial step.
With Async Load, the graph might take a few frames to be initialized since this happens on a separate thread. So it is best not to use the GraphOwner object immediately after you instantiate it. There is also a boolean -> ‘GraphOwner.initialized that you can use to check if the graph is initialized (thus AsyncLoad finished). There is no even for that currently, but I can add one if that helps.