Hello everyone. I am trying to do a quick and dirty IK setup for my game, but for some reason my blueprint keeps printing that no socket exists, in spite of one conclusively and evidently existing.
I have one socket, called “LH” (Left Hand) in my model. Here is a picture of the socket in the model viewer.
all it does is just fetch the socket, which should be working.
And here is the result…
It prints out the correct model name, which means that we should be trying to access that model’s sockets. Yet it seemingly fails.
Can anyone please tell me what I am doing wrong? From the various tutorials I looked at, my set-up should be as bog-standard as it comes. A million thanks in advance.
I’m pretty sure it’s because in your “GetLHSocket” macro, you are referencing the “Equipment View Model,” (not sure exactly what type of component this is) instead of the SkeletalMesh component that you use to get the object name.
“Equipment View Model” is a Skeletal Mesh Component, it was originally passed as something else indeed (I did not write it down before making the change, although it was an object type suggested by the get socket node, which means it was most likely a scene component object reference).
The socket nodes in the macro do not admit skeletal mesh assets. So I instead tried to passing along the Skeletal Mesh Component to the macro. Unfortunately, the result was the same.
I then tried using the socket nodes that are exclusive to the Skeletal Mesh Asset type. But unfortunately, it returns null. Below is an image of the slightly hacky test blueprint I used, as you can see, I bypass the macro entirely and instead check directly the Skeletal Mesh Asset (which does have a socket by that name).
Update: It occurs to me that using the Skeletal Mesh is probably not a great idea, since they don’t have sockets (outside of bones being used as sockets), as far as I can tell. Most resources I found online add the sockets to a static mesh, the one presumably used by the skeletal mesh.
If Equipment View Model is the skeletal mesh component, you need to find socket location from that directly. I believe the “Skeletal Mesh Asset” you are pulling is just reference to the specific asset, but not necessarily the spawned Skeletal mesh.
It needs to be a skeletal mesh if you are planning on having animations associated with the gun (like reloading and cycling the weapon, etc.). The bones would be the “sockets” or you’d add sockets within the bone tree.
That is a good point, as far as I’ve seen, you’d only be adding those “sockets” in that manner (showed in your first images) for static meshes… so maybe the engine doesn’t see those since they aren’t apart of the tree?
After some further messing around, I found that Skeletal Mesh Assets don’t use a static mesh as a base (meaning that sockets don’t transfer from the static mesh to the skeletal mesh), and that sockets can be created for a skeletal mesh (they just use a different method because UI/UX consistency is hard).
For the future reference of anyone reading this thread, on static meshes there is a dedicated window for adding sockets. On skeletal meshes, you instead right-click on a bone in the bone hierarchy and select “create socket” (the socket won’t have a 3D wire-mesh object like on a static mesh, it will just be a point in space where your gizmo overlays upon).
So indeed, the approach you suggested @Sklor is the correct approach and the solution to my issue, I was just missing knowledge on creating a socket for a skeletal mesh. Most likely, my original approach does work, but only for static meshes.