Attaching a hitbox to the character's head

I’d like to have hitboxes on the different parts of my character’s body. How can I do this ? The best i’ve been able to do is a capsule that I placed around the head (I did only this atm) but I’m pretty sure there’s a better way to do this. Is there a way to “attach” my hitbox to a bone or a region of the mesh of the character ?

Thanks

Yes there is in the component panel drag the capsule onto the skeletal mesh component, this will parent it to the mesh then in the details panel for the capsule you should now see a sockets area just below the scale settings, this is where you assign the bone that it should attach to by clicking on the search icon and then scroll down to the head bone and select it. Like this:

1 Like

i tried it, but i cant eddit the parent socket…

Make sure the collision component is attached to the mesh component (drag it onto the mesh component to attach it in the components tab) and you should be able to edit the parent socket.

Thank you, that solved my problem!

Any idea how this is done in C++? I cannot find a method that takes SkeletalMesh instead of SceneComponent