Attach multiple component to the same socket

Hello, I would like to attach several components to the same socket, basically I use the attach component to component function but the basic logic replaces the object attached to the socket. I would like to build from this basic socket an object stack, and then add each object to the chain by changing the relative position, thanks

1 Like

Hi @Ezekiel4000
AFAIK you can only have one mesh attached to a given socket at a given time.
If you want the meshes to all be visible at the same time, you could try to clone your existing socket on the mesh itself, once for each mesh you want to attach.
So the sockets will have different names but always the same transform.
Then attach the different meshes to those differently named sockets, and the meshes should all appear superimposed.

Good Luck :four_leaf_clover:

1 Like

Hi @Maciek_Leto first thank you very much for your reponse, may I ask what do you mean by “clone the socket on the mesh itself” ? Do you mean to doing it directly in the skeleton tree ? Or there is a function in blueprint for doing this ? I’m new to this world :wink:
Thank you for your time!

Yes.

However, this approach may not be optimal for your use case.
If the individual meshes make up a fixed set (e.g., the parts of a weapon), I would suggest joining them together in blender, and then exporting to UE as a single .fbx file.
If you then need to hide some mesh, scale the corresponding bone to zero.

1 Like

Thank you very much sir for your time and answer, I explored this approach, but I won’t work with I want to do, I’ll explain : I want to do a kind of dynamic inventory system on my character, and when I get an object it’s attached to my character dynamically, maybe it’s not possible with blueprint but can we create dynamically socket and attach this socket to the origin socket created in the skeleton tree ? Or is there a better way to do it ? Than you !
EDIT : Actually I have created several socket and when I get an object it goes to a socket that I get with an array with the names of theses socket, the problem with this method it’s I don’t know if the socket is empty and can attribute the object, and if I want to add a socket I need to add it’s name on the array so it’s not scalable, is there a better way to do it ? I didn’t find any method on blueprint for doing this

Hi @Ezekiel4000 - I think there’s a better way - just looked up something I did in C++ last year: I had various actor classes which I attached all to the same socket with AttachToComponent, and used SetActorHiddenInGame(true). This was changed to false when the single actor needed to be visible on the screen. This should work in blueprint too :grinning:

So, yes, you should be able to have all your inventory attached to a single socket. (at least if they are separate actors)

AFAIK you cannot add sockets procedurally.

1 Like

Hi, @Maciek_Leto Thank you very much for your time and help, yeah it’s seems a good way for dealing this! Thank you !