Attach Static Mesh to Socket

Hello

I tried to attach a sword (static mesh → moveable) to a socket from player (3rd person), when he walks over a trigger.

What I have done:

  1. I create a socket in skeletal mesh editor (socketname = sword)
  2. Added a trigger with sword mesh in middle (I also tried a skeletal mesh)
  3. I created this in level blueprint → I also tried nearly same in character- and sword blueprint

Somehow sword doesnt attach to socket. Instead it is floating in front of me. Its such easy to do that in UDK engine, but somehow I cant get it to work in UE4. Have I missed anything?

Thank you for your answers!

blueprint.jpg

Hey Philipp,

Thanks for your post! Two things you’ll need to change to get behavior you are looking for:

  1. You will actually want to use Attach Actor to Component. reason is that pointing directly to Get Player Pawn does not get your Pawn’s skeletal mesh, thus it will not get Socket list for mesh. What you can point to instead is Get Player Character, which will allow you to drag off Return Value and use Get Mesh, which you can pin into In Parent of Attach Actor to Component.

  2. You will also want to change enum Attach Location Type to be Snap to Target so that it snaps to your socket and doesn’t apply any kind of offset. If you need to use an offset, you can still use KeepRelativeOffset and apply a translation.

Here is a screenshot of setup described above that I used to move my static mesh (Basic Asset) into my WeaponPoint socket:

Let us know if you have any additional questions.

Thanks!

-Steve

1 Like

Thank you very much, now its working :smiley:

This is extremely helpful, thanks so much. An ah-ha moment :slight_smile:

This is useful, but what if I want to attach asset to a blueprint character which is not Player Character but for example a bot. When I use reference to blueprint character it only attach to center of object.

Did you make same named socket on bot?

Hey all,

This is an old Archived post from our Beta users, and isn’t best place to get current information and answers. If there are still questions about this topic, please open a new post and we can address it there. Thank you!