As you found out, custom tasks have to be in a script of their own with the names being the same. I also throw a warning log if they are not. This is done for safety 🙂
When it comes to custom variables, there are 2 seperate things that you need to take care of:
– First is the VariableData which is what lives on the blackboard.
– Then is the BBVariable which is what can be used in tasks to allow a direct value or a blackboard variable value and is responsible for the intercommunication.
So by just creating a BBVehicle : BBVariable, you are able to use that in a task and if you press the inspector radio button it will allow you select a Vehicle type from the blackboard or directly assign one in the inspector.
If there exist any variable on the blackboard that is or derives Vehicle it will be selectable.
If Vehicle derives a UnityEngine.Object then you don’t really need a custom VariableData since the existing variable Object type can be set to any UnityObject.Type (by the small button on the right in the inspector).