First of all, if your coming from Unity, the equivalent of prefab is bluePrint. Within your bluePrint, there are components you create from the class/bluePrintEditor such as camera, springarm and so, and there are bones of the skeletal mesh which are simply the nodes in Unity terminology.
For instance, if your BluePrint is based on an imported vehicule FBX which is constitued out of wheels, body, dashboards and so, then these elements are referred to as “bones of the vehicle’s skeletal mesh”. To access these bones and rotate/position them individually, then use the piece of code below:
#include "UObject/ConstructorHelpers.h"
#include "Math/Transform.h"
#include "Components/PoseableMeshComponent.h"
AMyPawn::AMyPawn() // the constructor of the blueprint class whose skeletal mesh's bones you want to access and position/rotate
{
// ....
static ConstructorHelpers::FObjectFinder<USkeletalMesh> ActorMesh(TEXT("/Game/path_to_your_skeletalMesh/yourSkeletalMesh.yourSkeletalMesh")); // load the skeletal mesh.
UPoseableMeshComponent* PoseableMesh = CreateDefaultSubobject<UPoseableMeshComponent>(TEXT("name_of_your_choice")); // create a container that will host your skeletalMesh's bones structure and enables you to position/rotate them individually.
PoseableMesh->SetSkeletalMesh(ActorMesh.Object); // Point your container to the skeletalMesh whose bones you want to process and position/rotate.
__int32 numberBones = PoseableMesh->GetNumBOnes();
for(__int32 i = 0; i<numberBones; i++)
{
FName const BoneName = PoseableMesh->GetBoneName(i);
FVector location; // initialize them as you wish
FQuat Rotation;
FVector Scale;
FTransform transform(Rotation, location, Scale);
PoseableMesh->SetBoneTransformByName(BoneName, Transform, EBoneSpaces::WorldSpace);
}
// ...
}