the problem is that when the tree is reloaded (I change script and the node editor says “Recompiling”), the variable name is gone. Attaching before and after picture:
Actually none of my nodes that use custom BB types save the values in the inspector (regardless if it is a temp variable, bb variable or something else)
Yep, you have to mark them all as [Serializable] 🙂
By the way:
– You can just use the [BlackboardOnly] attribute without initializing the BBVariable like {blackboardOnly = true}. This was the old way of doing this and that’s why some tasks still have it which I have not changed yet 🙂
– You can have your classes in any namespace you want if you have your own ECO namespace for example. They don’t have to be in the NodeCanvas.Variables or NodeCanvas.Actions respectively.
– In your info property you can use for example abilities.ToString() to get a nice formated text if you want like:
{return “NPC -> ” + abilities;} You can do this for any BBVariable of course.
– The agent is a Component type. You can GetComponent from it directly without going through the .transform
agent.GetComponent().abilities;