Add Perception Source Stimuli to PlayerCharacter

This commit is contained in:
Louis Hobbs 2023-02-16 18:27:34 +00:00
parent 40db233d6c
commit 9ed5da5792
2 changed files with 7 additions and 0 deletions

View File

@ -46,6 +46,10 @@ APlayerCharacter::APlayerCharacter()
CharacterMovementComponent->AirControl = 1.0f;
CharacterMovementComponent->bOrientRotationToMovement = true;
// Setup the character perception component
PerceptionSource = CreateDefaultSubobject<UAIPerceptionStimuliSourceComponent>(TEXT("Perception Source Stimuli"));
PerceptionSource->bAutoRegister = true;
this->Tags.Add(FName("Player"));
}

View File

@ -12,6 +12,7 @@
#include "Engine/EngineTypes.h"
#include "Engine/DamageEvents.h"
#include "Blueprint/UserWidget.h"
#include "Perception/AIPerceptionStimuliSourceComponent.h"
#include "PlayerCharacter.generated.h"
class UInputAction;
@ -80,6 +81,8 @@ private:
class UUserWidget* currentPlayerHUD;
UAIPerceptionStimuliSourceComponent* PerceptionSource;
public:
// Sets default values for this character's properties
APlayerCharacter();