Attached actor sticks to the pivot of parent skeletal mesh instead of the socket

As the title says, I’m trying to attach a weapon actor -which has a static mesh as the root component - to my character, it used to work on my previous project and I copied the code from there (which includes the TransformRules and AttachToComponent fucntion)

The attachment works but instead of snapping to the desired socket that I placed on one of the bones it sticks to the pivot point of the parent skeletal mesh component

I’ve been struggling with this issue for too long now, any help is appreciated!

OMG it turned out that I didn’t pass the insocketname parameter to attachtocomponent function in cpp, UNBELEIVABLE! xD