Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

AI Perception limit sight problem

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;

AI Char

   UAIPerceptionSystem::RegisterPerceptionStimuliSource(this, UAISense_Sight::StaticClass(), this);

AIController BP

alt text

Im quite lost, so I came here to ask for help

Product Version: UE 4.12
captura.png (459.9 kB)
more ▼

asked Oct 25 '16 at 08:27 PM in C++ Programming

avatar image

1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question