How can I "get" a socket on a static mesh inside a Blueprint?

Basically, I’m trying to access the sockets on a mesh inside a Blueprint. I’d like to attempt to snap two Blueprint actors together during gameplay and have them snap their sockets together when close, but I can’t figure out how to “get” the sockets.

Hi Charles,

If this is urgent for you, here i made these graphs which should help you i guess. You will need a variable with type name as array. You will then need to add the socket names to it and using ForLoop node you can iterate through each sockets and do whatever you want. You can also add more sockets later and for loop will take care of the rest. :slight_smile:

Taking it further if you want to access specific sockets ie: For example you have sockets SP_Socket1, SP_Socket2, Socket3, Socket4 etc. You want to do stuff only for SP_* Sockets. Then you will need a graph like this which will only do stuff for SP_Socket1 and SP_Socket2 and ignores Socket3 and Socket4.

Hope this helps. :slight_smile:

1 Like

You can use the Get Socket Location to get the socket location. If you want to get Socket Location + Rotation + Scale altogether then you can use a single Get Socket Transform node. But if you are using the SpawnActor node to dynamically spawn Blueprints and trying to access sockets for them, then you will need to use [Interfaces][1] for that. Let me know if you want that and i’ll be happy to assist you further. :slight_smile:

socketloc.png

socketlocnode.png

Thanks for the reply. I think what I’m looking for specifically is a way to get sockets with out needing to specify their name. I’m looping through a bunch of actors of a specific type and trying to collect all of their sockets to see which one the selected actor’s sockets are closest to. Can I use a wildcard in the socket name (*)?

Hey Charles,

Thanks for the question! I agree that it would be very helpful to be able to have access to all of the sockets (at least, the Socket Names) on a given Static or Skeletal Mesh, say in the form of an Array. Having this would allow you to be able to loop through as you requested and be able to perform the existing Socket functions on each Socket Name, which should help you accomplish your goal. I have filed a feature request to have this functionality added in a future Rocket Beta release.

Thanks!

-Steve

I appreciate it Steve. Thanks!