# How do I connect physical meshes with sockets?

**URL:** <https://forums.unrealengine.com/t/how-do-i-connect-physical-meshes-with-sockets/408449>\
**Category:** World Creation\
**Tags:** poseable-mesh, unreal-engine, Physics, question, CPP\
**Created:** [November 1, 2017, 2:09am UTC](https://forums.unrealengine.com/t/how-do-i-connect-physical-meshes-with-sockets/408449 "2017-11-01T02:09:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Legendary1214](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Legendary1214](https://forums.unrealengine.com/u/Legendary1214)\
**Post date:** [November 1, 2017, 2:09am UTC](https://forums.unrealengine.com/t/how-do-i-connect-physical-meshes-with-sockets/408449/1 "2017-11-01T02:09:14Z")

</div>

Hey, recently I have been having a problem with ue4 and sockets. After debugging I figured out it has something to do with the path. (Meaning it can’t find the asset). I was wondering if anyone could help.

(code)

PlayerInputComponent-\>BindAction(“Weapon1”, IE\_Released, this, &AStealthGameCharacter::OnSwitchWeapon1);  
//some lines later

UClass \*m\_cUClassWeapon = StaticLoadClass(UObject::StaticClass(), nullptr, TEXT(“knifeinprogressbetter”));

```
if (!m_cUClassWeapon) {
	GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("Can't find asset!"));

}

else {
	AActor *m_cWeapon = GetWorld()->SpawnActor<AActor>(m_cUClassWeapon);
	m_cWeapon->AttachRootComponentTo(GetMesh(), PlayerWeaponSocketName, EAttachLocation::SnapToTarget, true);
}

```

}  
If anyone could figure this out I would appreciate it greatly!  
Thanks
