//Skeletal Mesh
static ConstructorHelpers::FObjectFinder<USkeletalMesh> MyActor2_Component1_Visual(TEXT("/Game/Meshes/myCharacter"));
if (MyActor2_Component1_Visual.Succeeded())
{
GetMesh()->SetSkeletalMesh(MyActor2_Component1_Visual.Object);
}
=====
The UskeletalMeshSocket, Uskeleton and UphysicsAsset are added because I am experimenting and trying different stuff out. However, I feel like I have searched and tried everything under the sun. Is it doable?
I attached a picture showing what I am trying to do. In the picture I have used Blueprint to add a socked to my Skeleton, but I am trying to learn how to do it in code. Is it doable? I have thoroughly searched and tried a million things with no luck so I am here asking you guys.
mySkeleton->Sockets.Empty(); //Clears all sockets
mySkeleton->Modify(); //Not sure what this does but it is needed.
mySocket->SocketName =“mySocket”; //Obviously sets the sockets name
mySocket->BoneName =“Bone_004_end”; //Attaches to the bone you choose
mySkeleton->Sockets.Add(mySocket); //Finally adds the socket to the skeleton