Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How c++ Enum use in Behavior tree

I am interesting in how to use my c++ enum in Behavior tree from blackboard. I create Blueprint function library and I can add to any actor and use it. But how Blackboard tree can access to my c++ enum code?

My example below:

 class MYGAME_API UConstants : public UBlueprintFunctionLibrary
 enum class EUnitMainState : uint8
     Idle = 0 UMETA(DisplayName = "IDLE"),
     FollowPlayer UMETA(DisplayName = "FOLLOW PLAYER"),
     Action UMETA(DisplayName = "ACTION")
Product Version: UE 4.19
more ▼

asked Jun 29 '18 at 07:04 AM in C++ Programming

avatar image

41 2 7 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

alt text

enum.png (29.1 kB)
more ▼

answered Jun 29 '18 at 10:01 AM

avatar image

1.6k 6 6 12

avatar image funkish Jun 29 '18 at 12:41 PM

Thank you very much! It's work!

avatar image phil_me_up Jun 29 '18 at 12:52 PM

Glad it helped! Can you mark this answer as accepted to help others find it when they have the same issue. Thanks.

avatar image Bitwaker May 01 '19 at 03:27 PM

please accept this answer.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question