I have a gameobject which has a BheviourTreeOwner component. From there I created a simple behaviour tree and named it “DeerWalkBT”. And it works correctly.
Then from Window–>NodeCanvas I created a FSM and that was added to the scene root.
In this state machine I created a Nested BehaviourTree node and selected the previously created BT named “DeerWalkBT”. As soon as I did that (by clicking on the small circle and selecting it from the Unity pop up) my BT was renamed “BehaviourTree”.
If I try to rename it back to “DeerWalkBT” (or anything else) the nested node is deleted.
I’m not sure I understand this feature… I don’t want to have all my BTs named “BehaviourTree”.
All that is happening is that the behaviour tree assigned in a Nested Behaviour Tree State, is always named after the State’s name. If you change the state node name to anything, so will the assigned behaviour tree. This is done to keep naming consinstency.
The node never get’s deleted because of changing names though 🙂 I suppose you just selected back the BehaviourTreeOwner so the NC Editor loaded that behaviour tree back and you though of it deleted? Please confirm.
If you don’t want NC editor to automaticaly change based on selection, you can lock the editor (button on far right in the top toolbar ‘Lock’)
Furthermore the gameobject name is always named after the graph name.
This is very unintuitive IMO. If I create a behaviour tree and I work on that and name it “DeerBT” it’s because I want to be able to quickly select it from the hierarchy. If, at some point, I decide to use this tree also as a nested BT in a FSM, NC should never change its name (especially without asking) because a) “it ruins my plan” and b) I could have referenced that tree by name in some of my scripts and it wouldn’t work anymore.
With no offence 🙂
I also noticed that on the other hand, a nested FSM node in a BT doesn’t work that way. It works as I would expect.
So I changed the code in FSMNestedBT.cs at line 131 to this:
nestedBT.graphName = EditorGUILayout.TextField(“Name”, nestedBT.graphName);//nodeName;