How to grab StaticMeshComponent via C++?

Thanks for the answer, . Yeah, I couldn’t get the component because it didn’t exist on my C++ class. What I’m trying to do now is to auto-create a component on the constructor, so that every time I create a new Blueprint that derives from my C++ class, the component is already there.

So I’m defining a UStaticMeshComponent *rbComponent; in my .h file and in the constructor I’m doing:

rbComponent = NewNamedObject<UStaticMeshComponent>(this, TEXT("Static Mesh"));
rbComponent->AttachTo(RootComponent);

And it works, but when I click on the Static Mesh Component on my derived Blueprint, the details panel is empty?

This should be pretty simple, I guess. I must be missing something.

I really appreciate your help on this. Tips?