As it stands CollapseCategories will make every field appear regardless whether a UPROPERTY was marked as AdvancedDisplay. If AdvancedDisplay was chosen, I would expect the uproperty to be hidden until AdvancedDisplay is toggled.
#pragma once
#include "MyGame/Common.hpp"
#include "MyGame/Objects/MyGameObjectGroup.h"
#include "MyGame/AI/Director/MyGameAIDirector.h"
#include "Courage/Common.hpp"
#include "Courage/Debug.hpp"
#include "Courage/Preprocessors.hpp"
#include "CoreMinimal.h"
#include "MyGameAIGroup.generated.h"
class AMyGameCharacter;
class UMyGameAIComponent;
UCLASS(BlueprintType, Blueprintable, CollapseCategories)
class MYGAME_AI_API UMyGameAIGroup : public UMyGameObjectGroup
{
GENERATED_BODY()
public:
UPROPERTY(VisibleAnywhere, AdvancedDisplay, meta=(DisplayPriority = 2))
FMyGameAIDirectorInstance Director;
void Initialize() override
{
COURAGE_ENSURE_OR_RETURN(, _DirectorClass);
Director = FMyGameAIDirectorInstance(_DirectorClass.GetDefaultObject());
}
private:
UPROPERTY(EditAnywhere, meta = (AllowPrivateAccess = "true", DisplayPriority=1))
TSubclassOf<UMyGameAIDirector> _DirectorClass = nullptr;
};