Updated NPC plan
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "NPCAIController.h"
|
||||
#include "NPC.h"
|
||||
#include "BehaviorTree/BlackboardComponent.h"
|
||||
#include "Perception/AISense_Sight.h"
|
||||
#include "Perception/AISenseConfig_Sight.h"
|
||||
#include "NakedDesire/Player/NakedDesireCharacter.h"
|
||||
@@ -68,4 +69,13 @@ void ANPCAIController::OnTargetPerceptionUpdate(AActor* Actor, FAIStimulus Stimu
|
||||
|
||||
bCurrentlyObserving = bSensed;
|
||||
PlayerCharacter->StatsManager->SetObserved(bSensed, GetPawn(), GetObservationWeight());
|
||||
|
||||
// Surface the sighting to the behavior tree: the react/wander branch keys off "Player", and a
|
||||
// fresh sighting re-arms the one-shot notice reaction (see the BT handoff in PLAN.md).
|
||||
if (UBlackboardComponent* BB = GetBlackboardComponent())
|
||||
{
|
||||
BB->SetValueAsObject(TEXT("Player"), bSensed ? PlayerCharacter : nullptr);
|
||||
if (!bSensed)
|
||||
BB->SetValueAsBool(TEXT("bHasReacted"), false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user