Unity Behavior package: problems defining generic variables, actions and events

Hello eveyone! I’m currently working on a research project involving NPCs and I’m basing my AI-logic on the brand new Behavior package just released by unity. The package fits great for my needs of action-based behavior, control flow, AI-authoring and also debugging, but I’ve encountered some missing features that I’m not sure how to overcome. I’ll make a list to keep them separate and clear.

  1. BlackboardVariables cannot be collections of any type: i’d like to have a list of Transform to pick one of it randomly and move my character to, but I could not find a way to define it in the BehaviorGraph blackboard.
    I resolved just using a list of GameObjects but that would be great to have control for generics list too, as i would do in code defining List<Transform>

  2. Actions cannot extend other actions: I tried to make a new Action extending an existing one from script (not creating it from the Graph Editor but directly in my IDE), but when I try to add it on the graph it doesn’t appear on the “Add > Action” menu.
    Sometimes that would be useful to have a parent Action that defines a generic behavior and then child Actions that modify or extend this behavior. The feature I’d like to have is exactly the same of OOP Inheritance paradigm.

  3. UnityEvent cannot be referenced in graph: anytime I have an event occuring in my scene from various other C# scripts (not related to Actions or any of the Behavior package scripts) i typically use UnityEvents to handle them. I’ve seen that this variable type cannot be added in the control flow system of the behavior graph. I think that could be great to have it integrated in order to interrupt the execution flow of the graph and perform some other Actions “requested” by the event.
    I’ve found that the package implements an EventChannelBase class but from the manual I cannot really understand how to use it and extend it for my needs. Do you know any tutorial or reference that explains how to use it?

Is there any way I could handle these problems (apart from the few mentioned I already applied) in an elegant and structured way? Any help would be really appreciated, thank you in advance.

Hi @Cubert98

Thank you for your interest and reaching out!

Let me try to cover your topics:

This feature has been requested by many users and it is on our roadmap for early next year.
Hopefully you already implemented a workaround for now, but sorry for the inconvenience.


There are 2 parts to that bit:

  1. If you created a new action from your IDE, please make sure you have added the Serializable, GeneratePropertyBag and NodeDescription attribute above the class. Furthermore, ensure to provide a new id! If 2 nodes shares the same id, only the first one will be registered to the GlobalAsset registry.

  2. In regards to:

This should already be possible and we made sure to support this functionality. We implemented the built-in WaitForPhysicsMessageAction that way, and it derives into WaitForCollision and WaitForTrigger actions.


  1. Supporting UnityEvent sounds reasonable but there is a lot to consider over the UI/UX aspect as well as the fact that behavior graph are assets that don’t have direct reference to the sign (they need to get them from Blackboard Variable or node that access global instance).
    Sidenote - I’ve actually wanted to achieve something like that on a personal project and ended up creating:
  • a BehaviorEvent component that was providing a simple PlayEvent API.
  • a new Play Behavior Event action.
    I’ve then added a BlackboardVariable of type BehaviorEvent and was able to reference the component and raised it from the graph.

We are releasing a new documentation page to cover that topic in the next release (hopefully EOD).

Thanks again for your interest! Please don’t hesitate if you have more question or feedback, it allows us to make sure we steer the product toward the direction users needs the most! :slightly_smiling_face:

1 Like