How can I attach a Blueprint to a Socket in another Blueprint?

this is similar but not same to this

however above uses LEVEL blueprint and i want to do this entirely within a single blueprint which isnt a level blueprint?

closest ive come is to adding “child actor” in components tab and this seems to work in viewport, except attached blueprint disappears on play/simulate.

thanks

1 Like

Hey Bennetherwood,

As long as you have a reference to Blueprint you want to attach to your socket, you can use Attach nodes to accomplish this. Here’s an image of a simple setup for your Character Blueprint:

On whatever event you choose (L Key Event, in this case), it Gets All Actors of Class (choose whichever Blueprint you’re looking for in your level), and uses a For Each Loop to Attach Actor to Component. Array Element is Blueprint Actor, In Parent is Character’s Skeletal Mesh, and In Socket Name is exact name of Socket in your Skeletal Mesh.

Hope that helps!

1 Like

I’ve tried this method but nothing gets attached, I’ve tried this on Owen in content examples with no avail, can I clarify if this would work with a blank level ? And does attached still function like blueprint or an inanimate version of blueprint ?

This will work in any level with any Blueprint. If you’re using it on something without a skeletal mesh or socket, you can leave In Socket Name blank and it will just attach to pivot point of In Parent component.

Would you attach an image of what your setup looks like in Blueprints? Keep in mind that your Get All Actors of Class node is going to search for all Actors of Actor Class you select that already exist in game, and it will not work if you haven’t already spawned Actor.

No I haven’t spawned actor in world, but this isn’t a case of a character maybe picking up a gun blueprint and attaching it to a socket, this is a case of adding a blueprint to another and then being able then drag that blueprint from content browser into level with another blueprint being attached to a socket, or can this not be done ?
Thanks

I’m not sure I understand. Are you trying to do this during gameplay or during editing?

For Editing.

Ah, okay. What I was showing above is for use during gameplay. If you’re looking to attach one Blueprint to another that has a socket, you can use Socket Snapping in Editor:

https://docs.unrealengine.com/latest/INT/Engine/Content/Types/SkeletalMeshes/Sockets/index.html#socketsnapping

This will only work when attaching to Blueprints that have a Skeletal Mesh with Sockets already created. It will not allow you to drag a Blueprint out with another Blueprint already attached, but it will let you snap it into place pretty quickly.

I have tried this approach and it works for a skel mesh however for a blueprint with a skel mesh you don’t get option to attach to a specific bone/socket but I don’t know why? It just attaches it to pivot, could this be a big/lack of features ?

Hm, you’re right. Let me check in with developers this afternoon. I’ll let you know if we’re missing something or if this is something they can fix.

Thanks man !

I have entered TTP# 344536 into our bug database for this issue so our developers can take a closer look at it. I will let you know when I see an update on this. Thanks for pointing this out to us!

It looks like socket snapping methods did not consider Blueprint actors. This has been fixed internally and should appear in 4.6. Thanks for your patience!