Attaching actor to skeletal mesh socket doesn't work properly in Launch mode

MFurmanczyk
Sat, 23 Oct 2021 20:54:32 +0000
Character & Animation

Hello all!

I’m struggling a bit with attaching my weapon actor to skeletal mesh socket.

I’ve created a simple Actor containing StaticMeshComponent as its root and I’m trying to attach it to the skeletal mesh of my character. Everything works fine while playing in the editor but when I’m trying to play the game in launch mode the weapon is spawned at the location of my Skeletal Mesh.

WeaponActor->AttachToComponent(GetOwner<AMyCharacter>()->GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT("Weapon_lSocket"));

I tried changing the location to the socket location, variations of FAttachmentTransformRules values but nothing works Did anybody meet the same problem? I’ll be grateful for some help

BR

1 post - 1 participant