How to constrain socket attached actor on y axis in blueprint

Hello. I am working on a carry system similar to Half-life and Deus Ex where pressing interact on an item in the world such as a crate attaches that item to a socket on the root bone of my first person player skeleton. My problem is that I would like for the item to lift up and down when i aim up and down but without curving towards me as I do so. I am not quite sure how to explain this better so I am attaching an image to better express my difficulties. I was initially using no socket and using the teleport method for attaching the actor and positioning it however I found that this introduced a lot of bugs and weirdness to work around so I decided to do this with a two step process of attaching the item to a socket on my root bone and then using the teleport method to keep the item oriented in the viewport (if this isn’t making any sense hopefully the screen grab I post of the relevant bit of graph will help explain) This works superbly for keeping the item oriented for my player but not so much for the axis constraint.

I have tried as number of things but nothing seems to work. I feel like this should be something pretty simple and I am sure that it is and I am just missing it somehow but I just can’t seem to come to a solution for this on my own.

You will notice in the blueprint there is no attempt to constrain the item at all. This is simply because everything I have tried has failed and as such been removed. I am hoping to get some better ideas here.

By the way the red crosshair in the image represents the socket on my skeletal mesh.

A Huge thanks and endless gratitude goes to whoever can help me reel this issue in.

Hi !

If you have a specific item you want to carry, you can set a special socket to this item in the Mesh properties (double click on the mesh you want create a socket, then window => socket manager => create a socket that you can place where you want ).

With that, you can then get that socket by getting the object variable, then get the socket from that object and finally, attach this socket to the hand of the character (get character etc …)

If I had to do that, I would do it as I said, or something like that :confused:

Or you can get the socket from your hand (so get the location and rotation), and then set relative location and rotation with the item you want to attach …

Thank you very much for the reply but that’s not exactly what i’m looking for. I must apologize that I don’t think I am explaining it well.I am having no trouble attaching the item i just need for it to constrain it once attached so that it only travels on the y axis when I look up and down (but it still has to be able to move in other directions when I am walking with it in hand)

Awesome thank you :smiley:

If it would help any I would be happy to provide a more detailed look at the blueprint (I was planning to make it available through a tutorial once i got the whole thing working tightly anyway)

Hmmm … Ok I see what you mean :wink: I’ll try something and come back to you when I’ll have the answer :wink: