Hi guys!
I have a question about adding a Socket to a Skeleton using C++. The question in very simple, is it at all doable?
I have a Characteer class set up with a Skeletal mesh that has 5 bones. My code is as follows:
Header:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Testing”)
USkeletalMeshSocket* mySocket = CreateDefaultSubobject<USkeletalMeshSocket>(TEXT(“mySocket”));
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Testing”)
USkeleton* mySkeleton = CreateDefaultSubobject<USkeleton>(TEXT(“mySkeleton”));
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = “Testing”)
UPhysicsAsset* myPhysAsset = CreateDefaultSubobject<UPhysicsAsset>(TEXT(“myPhysAsset”));
=====
CPP:
//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.
Thank you in advance!