BHPro: Graph variables cannot reference game-object components on a subtree

Gigen

New member
Issue steps:
1. Create a subtree, give it a Graph variable that should reference a component (in my case, it was a FollowerEntity from A* Project)
2. Use the subtree on a BT instance (directly on a game object), link in the component (i.e. FollowerEntity -> might hold true for other component types as well, but I haven't checked)
3. Loss of focus results in the variable becoming null

Thanks!
 
This is a Unity restriction. Subtrees are stored at the project level which cannot reference scene objects. In the subtree video I give some more explanation:
 
Sorry, I think I was a little unclear with my explanation :)

1742806620693.png

Atlas crafting example:
If we look at the bottom left section of the screenshot, we can see that scene-level stuff (like CraftTable) is referenced in this BT (which derives from a subtree). This makes sense.

But if I assign anything else to that field instead of CraftTable, the field is not saved. Examples:
1. I can delete the field value outright, change focus, and when I'm back it's again set to CraftTable
2. I can assign another GameObject as the value, change focus, and when I'm back it's again set to CraftTable

TL;DR Changes aren't saved, neither in this example nor in my attempts to use the Subtree system. Super easy to reproduce. Hope this was clearer :)

Regards
 
I've actually found to way to make the field save. I guess it sets the BT to dirty or something.
1. Change a field (like reassigning a GameObject)
2. Change a variable name (in my case, I just replaced "Resources" in the screenshot with anything else)
3. Save (CTRL + S)

Upon loss of focus, the variable name is restored (so "Resources" becomes just that again), and the assigned variable is saved (instead of reverting). Hope this makes sense and helps you nail the issue.
 
Ahh, I see. Ok, I was able to reproduce that and have a fix. I'll send you a new build.
 
Back
Top