Hey guys , hope you’re fine !
I have a strange problem (maybe not , maybe i forget something) . I create a weapon class (scar) like this :
Scar.h
/** Collider and root component*/
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = sphereComponent)
TSubobjectPtr<USphereComponent> root;
/** SkeletalMesh of the weapon */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = SkelMeshComponents)
TSubobjectPtr<USkeletalMeshComponent> Mesh;
Scar.cpp
AScar::AScar(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
// Set up the sphere component as root
root = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("SphereColl"));
root->SetSphereRadius(0.1f);
this->SetRootComponent(root);
// Set up the mesh via a constructor helper
Mesh = PCIP.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("Mesh"));
const ConstructorHelpers::FObjectFinder<USkeletalMesh> MeshObject(TEXT("/Game/weapon/scar"));
Mesh->SetSkeletalMesh(MeshObject.Object);
}
But when i create a blueprint derived from this class and add it on the scene , i can move the “Guizmo” but my skeletal Mesh ( the weapon) still on its place , at least i thought at the base coordinates (0,0) , and when i drag’n drop it on the scene , the mesh is directly send at theses base coordinates.
I tried by setting the mesh in the blueprint , but i had the same problem