Why is GetAIController return null?

Fixed by running the behavior tree only in the server.