OK I have (probably?) solved the problem. It is simple, just save your ai controller reference on character begin play, and when you need to use ai, call the possess node of the ai controller and run behaviour tree.
My solution is as follows:
1)Make sure your characters in map don’t have auto possess player 0!
I write a possess function in the player controller, just get all actors in class and run possess node.
2)In Character’s event begin play, use get AI controller node and save a reference of it.
If you didn’t close auto possess, you won’t get an ai controller from the node!
(The comment is the original node name. Never mind me I’m lazy )
3)Use possess and run behavior tree nodes when you want the character possessed by ai controller
You don’t need to unpossess the player controller. Just use ai controller reference to possess and run your behavior tree.
(The comment is the original node name. Never mind me I’m lazy )
Hope this one helps… If I have further questions I will update the post.