Hi,
I am using BT for the enemy and when an enemy spawns from the pool system, I manually call treeOwner.StartBehaviour() (Do not start when enabled )
I using BT as assets (not bound to object because enemy prefab will be controlled by pool system)
After Profiling I see graph.StartGraph takes more than 100 ms in my Android device.(a medium speed Oppo branch device)
So is there any way to get smooth fps at run time? Maybe we can call some function at the start to preload or do the heavy work first?
Sorry for the late reply!
Right now, graphs are initialized as soon as the first execution call to them has been made, thus the first time the Behaviour is enabled/started.
I will introduce a way to pre-initialize behaviours in a future update soon, but until that is implemented, what you can do is to let the behaviours automatically start when enabled for one frame and manually stop them immediately by calling StopBehaviour(), only to call StartBehaviour() once again when you need the behaviour to start.
This way, the behaviour will get a chance to initialize.
Please let me know if that works for you, but once again, the ability to pre-initialize behaviours will be possible in a very soon to come update.
Thank you!
Hi!
Thank for your answer!
I push the initialize to the very first of game start and I think it is ok!
I will wait for the next version, thanks so much!