Attaching weapon to socket is'nt spawning good

When I attach weapon to my character socket its spawning it in a wrong place, not like I placed it in skeleton socket.
The problem just raised and I don’t really know what caused it, the exact same script used to work but suddenly somthing happend.
Any ideas what can caused it?
btw its not the same weapon but still has a problem.

Hello there. I must say you got me interested so I had to give this a try and it worked like a charm for me. I’m posting a video below. Let me know if this is what you wanted. You can have the gun stay on the ground after AI dies too but I found it a bit annoying after a while.

I used to attached weapons manually before this way seems way better.

How did I do this. Well I added a new socket to my “hand_r” bone, named it Gun
Then I just followed your steps. I have created a new blueprint actor and in Viewport added a Skeletal Mesh Component.
In my AI character on Event Begin Play I have added a small delay and then just used the nodes you posted above.

Edit: Forgot about Image

Hope this will help you.

Hi, In the AttachToComponent block the SocketName value is “Weap”. Is that the correct socket name?

The weapon is getting attached to the character so the socket name isn’t a problem here. It’s all about the rotation.
Just play around with rotation in your gun actor`s Viewport.

Hi there, thank you for your reply.
I think there is orientation bug because I placed right the socket with the weapon, but when I attach it it’s spawn in different rotation but same location.
I read about that bug but I don’t really know how to fix this. every object I place in any socket will be different rotation when spawned.

The weapon rotation when spawned is different from socket coordinates or socket coordinates wrong when I placed it.
Somthing is strange here.

Do you have an actor for your weapon? Any chance we could have a look at viewport of it.

Here you go, maybe it will help you out. Sorry my sound really quiet in the video, not used to record stuff. :smiley:
This is how I did it. Enjoy.

Thank you, I’ve seen that my weapon rotation was actually -90 degrees so after rotating this out it works fine! thank you for your effort!

Happy to help :slight_smile:

Created a new project just to be sure. I had a problem when the weapon spawned in the air but I have it all sorted out. Allow me some time so I can record a video of the whole process.