Download

Accessing Character Components in C++

I want to attach another skeletal mesh to my character’s mesh, because the inherited mesh is the body and the second mesh is the head. But I can’t attach the second mesh, because the inherited mesh is private. What should I do to have access?

You can simply add another USkeletalMeshComponent to your character class. C++Blueprint

if you already have the USkeletalMeshComponent, try this:



YourNewMesh->SetupAttachment(GetMesh());


This is a private member but it is accessible using the GetMesh function.

PS: also you can get the capsule component using GetCapsuleComponent();