x

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"

Cannot Create UBehaviourTree pointer - Error: Unrecognized type 'UBehaviourTree' - type must be a UCLASS, USTRUCT or UENUM

I'm trying to create a UBehaviourTree pointer but I get theis error: Error: Unrecognized type 'UBehaviourTree' - type must be a UCLASS, USTRUCT or UENUM when I compile it. Here is my code:

ElementalsEnemy.h:

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "BehaviorTree/BehaviorTree.h"
 #include "BehaviorTree/BehaviorTreeComponent.h"
 #include "BehaviorTree/BlackboardComponent.h"
 #include "BehaviorTree/Blackboard/BlackboardKeyAllTypes.h"
 #include "CoreMinimal.h"
 #include "GameFramework/Character.h"
 #include "ElementalsEnemy.generated.h"
 
 UCLASS()
 class ELEMENTALS_API AElementalsEnemy : public ACharacter
 {
     GENERATED_BODY()
 
 public:
     // Sets default values for this character's properties
     AElementalsEnemy();
 
 protected:
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
 
 public:    
     // Called every frame
     virtual void Tick(float DeltaTime) override;
 
     // Called to bind functionality to input
     virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
 
     UPROPERTY(EditAnywhere)
     UBehaviourTree* BehaviourTree;
 };
 

ElementalsEnemy.cpp:

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #include "ElementalsEnemy.h"
 #include "BehaviorTree/BehaviorTree.h"
 #include "BehaviorTree/BehaviorTreeComponent.h"
 #include "BehaviorTree/BlackboardComponent.h"
 #include "BehaviorTree/Blackboard/BlackboardKeyAllTypes.h"
 
 // Sets default values
 AElementalsEnemy::AElementalsEnemy()
 {
      // Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
     PrimaryActorTick.bCanEverTick = false;
 
 }
 
 // Called when the game starts or when spawned
 void AElementalsEnemy::BeginPlay()
 {
     Super::BeginPlay();
     
 }
 
 // Called every frame
 void AElementalsEnemy::Tick(float DeltaTime)
 {
     Super::Tick(DeltaTime);
 
 }
 
 // Called to bind functionality to input
 void AElementalsEnemy::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
 {
     Super::SetupPlayerInputComponent(PlayerInputComponent);
 
 }

How can I fix this?

Product Version: Not Selected
Tags:
more ▼

asked Feb 21 '18 at 05:57 PM in C++ Programming

avatar image

Muirey03
18 5 8

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

1 answer: sort voted first

UBehaviorTree, not UBehaviourTree (pesky American spellings)

more ▼

answered Feb 21 '18 at 06:36 PM

avatar image

Jamie Dale STAFF
7.5k 177 67 305

avatar image Muirey03 Feb 21 '18 at 06:42 PM

Thank you, feel like a right idiot now!

avatar image emperor_katax Apr 08 '18 at 10:13 AM

.. wow , this was exactly my problem .... many thanks, your post save me time a llllllot .... ; D ,,

avatar image lewisscrivs Apr 13 '18 at 06:49 PM

Same here ahahahha, Thanks.

(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