Hi! I am making an steath game in C++ and blueprint, I have a roaming AI following some points.
I want the AI to only see the player if the player is in a 180º angle in front of the AI, but it seems not working.
I tried to change the peripheral vision angle to 90º or 180º and it keeps detecting me in 360º (When I use the gameplay debugger the green area is in 360º and the update event triggers ).
I’m using a mixture of c++ and blueprints (Since I could not get to work the .AddDynamic).
AIController .h
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
UAIPerceptionComponent* PerceptionComp;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
UAISenseConfig_Sight* sight_conf;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
float PeripheralVisionAngleDegrees;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
float SightRadius;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
float LoseRadius;
AI Controller.cc
PerceptionComp = GetAIPerceptionComponent();
PerceptionComp = CreateDefaultSubobject<UAIPerceptionComponent>(TEXT("AI PERCEPTION COMPONENT"));
sight_conf = CreateDefaultSubobject<UAISenseConfig_Sight>(TEXT("AI SIGHT CONFIG"));
sight_conf->DetectionByAffiliation.bDetectEnemies = true;
sight_conf->DetectionByAffiliation.bDetectNeutrals = true;
sight_conf->DetectionByAffiliation.bDetectFriendlies = false;
sight_conf->PeripheralVisionAngleDegrees = PeripheralVisionAngleDegrees;
sight_conf->SightRadius = SightRadius;
sight_conf->LoseSightRadius = SightRadius + 1;
PerceptionComp->ConfigureSense(*sight_conf);
AI Char
UAIPerceptionSystem::RegisterPerceptionStimuliSource(this, UAISense_Sight::StaticClass(), this);
AIController BP
Im quite lost, so I came here to ask for help