Why AIController.h's PerceptionComponent cannot be edited in blueprint?

If you create a subclass of AIController, you’ll see both Actions Comp and Path Following Component in the list of components, but not the PerceptionComponent. Why? They’re both set as VisibleDefaultsOnly in AIController.h.

Also, is there a “correct” way to handle this, other than adding yet another AIPerceptionComponent in your AIController subclass?


(Note: opened source file in image is AIController.h, not ModularAIController.h)

Edit : I just realized this post is from last November so it’s probably not still relavent, but I’ll just leave this here in case anybody else needs help.

Hi @Ixiguis - If I’m not mistaken, the AAIController constructor does not natively create the UAIPerceptionComponent subobject. If you want to create it and edit it you will have to override your child classes constructor to create it.

AVehicleAIController::AVehicleAIController(const FObjectInitializer& OI)
	: Super(OI.SetDefaultSubobjectClass<UVehiclePathFollowingComponent>(TEXT("PathFollowingComponent")))
{
	PerceptionComponent = CreateDefaultSubobject<UAIPerceptionComponent>(TEXT("PerceptionComponent"));
}

That should resolve the issue.