This seems like it should be straightforward since the Physics Constraint Object has a Constraint Bone property for each component. The use case is that I have an object that needs to attach to one of the moving parts of this mesh using physics. However if I set the Bone Name to one of the bones in the Skeletal Mesh, the joint ends up connecting to 0,0,0. (Note that if I leave the bone empty, it connects to the Skeletal Mesh directly, but it won’t follow the bone when it moves. It also works this way if I add an invalid bone name.)
I think I’ve tracked it down to USkeletalMeshComponent::GetBodyInstance. It finds the Body Index in the Physics Asset, but the Bodies array is empty here:
int32 BodyIndex = PhysicsAsset->FindBodyIndex(BoneName);
if(Bodies.IsValidIndex(BodyIndex))
{
BodyInst = Bodies[BodyIndex];
}
I can’t find any way to get this to populate, I searched through the code and the only references to the Bodies array are reading from it.
If anyone has had luck using Physics Component to attach to a bone in a skeletal mesh I’d love to hear how!