How to retrieve actor(s) attached to a socket?

Yes, you can.

 //Loop through all the sockets of the mesh
     for (auto SceneComp : GetMesh()->AttachChildren)
     {
         GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, SceneComp->AttachSocketName.ToString());
 
 //We want to get all children of a specific socket name
         if (SceneComp->AttachSocketName == this->HolsterGrenadeWeaponSocketName)
         {
 //Now we found the socket that we want, so lets loop though all the children of this socket and print out each child's name
             for (auto x : GetMesh()->AttachChildren)
             {
                 // we found an actor!
                 GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Blue, x->GetFullName());
             }
         }
     }
1 Like