Hello!
When I create an inherited class of APawn, I had add UStaticMeshComponent* MeshComponent against of SceneComponent to properties. In constructor of the class I called:
SceneComponent = CreateDefaultSubobject<USceneComponent>("SceneComponent");
SetRootComponent(SceneComponent);
MeshComponent = CreateDefaultSubobject<UStaticMeshComponent>("MeshComponent");
As you see, I did not call MeshComponent->SetupAttachment(SceneComponent);
Then I run project editor (F5), created BluePrint from my C++ class, and I see that the MeshComponent already attached to the SceneComponent:
Components ierarhy:
Scene Component (SceneComponent) (Inherited)
Mesh Component (MeshComponent) (Inherited)
So for what I needed to call the
USceneComponent::SetupAttachment ?
Regards, Andrew