Add Perception Source Stimuli to PlayerCharacter
This commit is contained in:
parent
40db233d6c
commit
9ed5da5792
|
@ -46,6 +46,10 @@ APlayerCharacter::APlayerCharacter()
|
||||||
CharacterMovementComponent->AirControl = 1.0f;
|
CharacterMovementComponent->AirControl = 1.0f;
|
||||||
CharacterMovementComponent->bOrientRotationToMovement = true;
|
CharacterMovementComponent->bOrientRotationToMovement = true;
|
||||||
|
|
||||||
|
// Setup the character perception component
|
||||||
|
PerceptionSource = CreateDefaultSubobject<UAIPerceptionStimuliSourceComponent>(TEXT("Perception Source Stimuli"));
|
||||||
|
PerceptionSource->bAutoRegister = true;
|
||||||
|
|
||||||
this->Tags.Add(FName("Player"));
|
this->Tags.Add(FName("Player"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
#include "Engine/EngineTypes.h"
|
#include "Engine/EngineTypes.h"
|
||||||
#include "Engine/DamageEvents.h"
|
#include "Engine/DamageEvents.h"
|
||||||
#include "Blueprint/UserWidget.h"
|
#include "Blueprint/UserWidget.h"
|
||||||
|
#include "Perception/AIPerceptionStimuliSourceComponent.h"
|
||||||
#include "PlayerCharacter.generated.h"
|
#include "PlayerCharacter.generated.h"
|
||||||
|
|
||||||
class UInputAction;
|
class UInputAction;
|
||||||
|
@ -80,6 +81,8 @@ private:
|
||||||
|
|
||||||
class UUserWidget* currentPlayerHUD;
|
class UUserWidget* currentPlayerHUD;
|
||||||
|
|
||||||
|
UAIPerceptionStimuliSourceComponent* PerceptionSource;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Sets default values for this character's properties
|
// Sets default values for this character's properties
|
||||||
APlayerCharacter();
|
APlayerCharacter();
|
||||||
|
|
Loading…
Reference in New Issue