C++ custom component can not see/edit defaults unless added in BP

Hi, banging my head against this, maybe someone can help.

I have a newly created component derrived from UStaticMeshComponent (I use a mesh overlap as the start of the aiming system). When i add it to my player controller in c++, the details panel is blank, when i add it via blueprint, it is populated properly, i have no idea why.

header file for player controller has this code:

private:
	UPROPERTY(BlueprintReadWrite, VisibleAnywhere, meta = (AllowPrivateAccess = "True"), Category = "Components")
	UAimAssistComponent* AimAssistComponent = nullptr;

cpp file has this

AMyPlayerController::AMyPlayerController()
{
	AimAssistComponent = CreateDefaultSubobject<UAimAssistComponent>(TEXT("AimAssist"));
	AimAssistComponent->bEditableWhenInherited = true;
	AimAssistComponent->SetupAttachment(GetRootComponent());
}

if i add my component via BP editor, i see all the details i would expect so i assume my problem is with the c++ bit above. Weird thing is though that i duplicated this code for adding a dummy static mesh component and i could see its details fine.

Any help or pointers on where to start looking would really help.

So somehow my BP version of my player controller had got itself into a strange state. Making a new one seems to have fixed the issue. A bit worrying though. If anyone knows how i might have recovered from this without having to delete and rrecreate the BP that would be really useful.

Try the following UPROPERTY specificers:

UPROPERTY(BlueprintReadOnly, VisibleDefaultsOnly, Category="Components", Meta=(AllowPrivateAccess="true"))

Did you use hot reload? While this can be fine when modifying a bit the core of some functions when adding new features it can be a bit faulty.
I usually quit the editor and do my modifications / implementations and then relaunch to test the whole thing.
When my cpp classes are inherited or else I tend to reparent everything and basically just redo the whole import and such. C++ is not awesome for updating it’s own changes on the run unlike scripted languages.

I had this problem and I tried a lot of things, also generating new sln files and it didn’t work, it also worked before and it got broken all of a sudden without a reason (seemingly)
What worked for me was

  1. Reparenting the blueprint
    2.Closing the editor
    3.Running it from the editor (rider in my case)
    4.Changing the blueprint to the right parent