Got it… Kinda. I couldn’t get it to set in the editor but I was able to set up some C++ in the constructor to expose the Sight Config to the editor.
Header:
protected:
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Perception")
class UAIPerceptionComponent* PerceptionComp = nullptr;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Perception")
class UAISenseConfig_Sight* Sight = nullptr;
CPP:
Sight = CreateDefaultSubobject<UAISenseConfig_Sight>(TEXT("Sight Sense"));
if (Sight)
{
// Sight configuration
Sight->SightRadius = 500;
Sight->LoseSightRadius = 600;
Sight->PeripheralVisionAngleDegrees = 180.0f;
Sight->DetectionByAffiliation.bDetectEnemies = true;
Sight->DetectionByAffiliation.bDetectNeutrals = true;
Sight->DetectionByAffiliation.bDetectFriendlies = true;
PerceptionComp->ConfigureSense(*Sight);
}
I hope that helps!