Placing object to closest "socket" location from player's linetracing hit location

Hi, here I am again with another problem. This time it is about line-tracing of which I am not entirely sure I understand 100% of it but I thought I would be able to get the closest “socket”, which in this case is simply a child actor component that I use to hold that position and rotation, and then simply set the location to it when creating the object, but it seems the few things I have tried did not work. I might change the “socket” itself for a proper transform variable, but for the time being it does the job pretty well.

Anyways, here is my current blueprint setup for the placement of the object with a few annotations inside explaining what the other parts before and after does but weren’t included to keep the image relatively clear.

And the structure I use on my object:

311255-capture12.png

Would anyone happen to know how I could get the closest “socket” location to the player’s hit location?

PS: I have already searched and looked at a few other answered questions, but none seemed to work for me or in some cases were super buggy/glitchy where the block could be placed twice on the same spot and so on.

Let me know if you want me to make some area clearer and I will try my best to do so ^^’.

Also, if you have any other improvement you would like to make over the other stuff feel free to suggest and I will try my best ^^ I am mostly trying to make it work at this point to allow me to learn blueprints’ advanced stuff and then I will rework the whole thing into a more efficient/orderly way.

Another point I forgot to say is that the only time I had it working relatively properly is when I was getting the closest point towards the player, but that didn’t work well for building vertically.

I have the solution ^^ I simply used the wrong variables in the wrong order.
This method is a pretty basic one and is far from perfect, but it works good enough for a simple building game with shapes that would fit inside the same cube’s space.

I am adding this here in the possibility that it could help someone else having the same problem as I had.

And the result: (It is not perfect, but it is more than enough for what I want currently ^^.)

311304-output16.gif

Old post, but had the same issue and got to say thank you, works perfectly at the moment for what I’m doing.