UObjectProperty properties within a UActorComponent class aren't exposed for editing in the Details panel when choosing to edit native component defaults in the BP editor.
1. Create a new (blank) C++ project.
2. Add a new C++ class based on AIController (MyAIController).
3. Modify MyAIController.h to include the following changes to the UClass declaration:
UCLASS(BlueprintType) class UE_34847_API AMyAIController : public AAIController { GENERATED_BODY() AMyAIController(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get()); };
4. Modify MyAIController.cpp to include the additional constructor code:
#include "Perception/AIPerceptionComponent.h" AMyAIController::AMyAIController(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { CreateDefaultSubobject<UAIPerceptionComponent>(UAIPerceptionComponent::StaticClass()->GetFName()); }
5. Compile the C++ project and either relaunch the UE4 editor or allow hot reload to pull in the updated C++ code.
6. Create a new Blueprint class based on MyAIController and open it in the Blueprint editor.
7. Select the PerceptionComponent (inherited) and refer to the Details tab.
8. Add a new AISenseConfig_Sight object to the SensesConfig array property and expand the new entry for editing.
9. Notice that the DetectionByAffiliation property cannot be edited.
10. Add a new AIPerceptionComponent to the Blueprint, select it and refer to the Details tab.
11. Add a new AISenseConfig_Sight object to the SensesConfig array property and expand the new entry for editing.
12. Notice that the DetectionByAffiliation property can be edited.
Expected result: The DetectionByAffiliation property can be edited regardless of whether or not the component is inherited from the native C++ parent class.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-34847 in the post.
1 |
Component | UE - Gameplay - Blueprint |
---|---|
Affects Versions | 4.12 |
Created | Aug 17, 2016 |
---|---|
Resolved | Aug 18, 2021 |
Updated | Aug 18, 2021 |