Attach component to actor socket

i’m trying to attach a sword to my player but it isn’t getting the socket’s name, it’s attaching to the root bone

void ABaseWeapon::pickUpWeapon(AThirdPersonCharacter* player) {
	weaponMesh->SetSimulatePhysics(false);
	RootComponent->SetUsingAbsoluteRotation(false);
	FName socket = "DefaultWeapon_back";
	this->AttachToActor(player, FAttachmentTransformRules::SnapToTargetNotIncludingScale, socket);
}

alt text

Actors don’t have sockets, meshes do. If you take a look at the AttachToActor() implementation, you’ll see that underneath there’s an AttachToComponent() function that attaches to the DefaultAttachComponent; I think in your case the DefaultAttachComponent is not the Skeletal Mesh, but probably the RootComponent? And it doesn’t have any sockets.

First of all, see which component is returned by the GetDefaultAttachComponent() function. Then you can carry on from that.