How c++ Enum use in Behavior tree

It’s not very clear in the UI, but the way to do this is:

  1. Setup your enum (as you have done)
  2. Within your blackboard, add a new ‘Enum’ variable type
  3. Expand the Key Type
  4. You won’t be able to fill in the ‘Enum Type’ from the selector. but you can enter a custome name in the ‘Enum Name’ field. Enter you’re enum name here (e.g. EUnitMainState)
  5. Once you typed the name, be sure to hit enter
  6. Check the ‘Is Enum Name Valid’ tickbox. It should now be ticked. If not then it’s because you’ve entered the name incorrectly or you may need to re-compile the project. You should also now see the Enum Type field is filled in too.

Here’s a screenshot of the final result

10 Likes