Description

If AIPerceptionComponent is set in code, a blueprint of the associated class cannot edit the Detection by Affiliation setting in the details panel for the component.

Steps to Reproduce
  1. Open UE4Editor (Any project)
  2. Create new classed based on AIController (MyAIController)
  3. In MyAIController.h, above the line: #include "MyAIController.generated.h", add #include "Perception/AIPerceptionComponent.h"
  4. In MyAIController.h right after the GENERATED_BODY() macro add the following:
    public:
    	AMyAIController();
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
    		UAIPerceptionComponent* PerceptionComp;
    
  5. In MyAIController.cpp add the following:
    AMyAIController::AMyAIController()
    {
    	PerceptionComp= CreateDefaultSubobject<UAIPerceptionComponent>(TEXT("PerceptionComp"));
    }
    
  6. Compile code
  7. In the editor create a blueprint based on MyAIController (MyAIControllerBP)
  8. In the blueprint select PerceptionComp in Components tab
  9. In Details panel add element to Senses Config array and set element to AI Sight Config
  10. Expand Sense drop down

Result:
Detection by Affiliation setting does not have dropdown for different options

Expected:
Adding AIPerceptionComponent through the code allows DbA to "Detect Enemies/Neutrals/Friendlies"

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

55
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.8.14.134.17.24.184.19.2
Fix Commit2782469
Main Commit2787214
CreatedJul 9, 2015
ResolvedAug 18, 2021
UpdatedMay 4, 2023
View Jira Issue