Created child component does not moved with root component

I am creating a class in c++ for a base of a later used blueprint. Somehow if I have created a Blueprint of it, moving the root component does not affect the child component (the static mesh component).

So I would guess its because of my code from the inherited class. This is what I am using within the constructor:

// Create a dummy root component we can attach things to.
RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT("RootComponent"));
// Create a static mesh object
building = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Building"));
building->SetupAttachment(RootComponent);

But this does not work. I can also see this, when I am dragging the Blueprint into the level, the mesh always spawns at the origin and don’t follow the mouse while dragging.

did you solve this?

Unfornutally I cant remember the exact problem but I think it is working. I cant really see a different in the setup I have made. Would you like to share more information about what exactly happens?

the same thing which you described, may be because components was statics

Thats a good point! I have checked the Mobility section inside the static mesh after it was created and it showed that it was set to movable (As I said I cant reproduce this problem neither know what I did). Maybe they have changed the default ?!