how to load BT?

NodeCanvas Forums General Discussion how to load BT?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9158

    i am practicing instantiating BT by sample sceane Demo1.
    i made prefab CommmonBehaviourTree, CommonBlackboard in resource folder.
    but loaded is null.
    what’s wrong?

    here is the code.

    void Start () {
    GameObject clone = Instantiate(Resources.Load(“Soldier”)) as GameObject;
    BehaviourTree bt = Instantiate(Resources.Load(“CommonBehaviourTree”)) as BehaviourTree;
    Blackboard bb = Instantiate(Resources.Load(“CommonBlackboard”)) as Blackboard;

    clone.AddComponent<BehaviourTreeOwner>();
    clone.GetComponent<BehaviourTreeOwner>().blackboard = bb;
    clone.GetComponent<BehaviourTreeOwner>().StartBehaviour(bt);
    }

    #9159
    Gavalakis
    Keymaster

    Hello,

    Can you please clarify what is null?
    Are you certain that the naming is correct and is matching the name of the prefab into the resources folder?
    Thanks

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.