Linetrace from Socket not Aligned

Hey guys, first thank you for helping and I appreciate any help! I’ve searched Youtube, Google, Unreal Forums ,etc to try and understand where I am going wrong.
I’ve messed with all the rotation settings for about 8 hours and just can’t get this to line up correctly. Usually I stumble upon a solution while either messing with settings or searching online, not this time.
I am trying to get a simple line trace to fire from my AiEnemyCharacters Gun Mesh. I set up a Socket in the bone on the muzzle. I can see the line trace fire from the character but its in the wrong direction. Should be easy fix, just change the rotation of the socket? Nope that doesn’t change the rotation of the line trace… So i rotate the mesh to see if thats why its firing the wrong way… and thats the issue but if I zero those rotation values now the mesh isn’t aligned with the character movement. it fires in the right direction but now my character is moving side ways.


So now I’m super lost… how do I get the socket to fire in the right direction…?

I attached a photo and a video, let me know if you need any other information.

Thank you in advance

1 Like

Ended up solving this myself, just incase anyone runs into the same problem, i attached a screenshot of the code and a video showcasing the result. You need to add getsocketrotation node before the forward vector to access the rotation. It was still firing sideways so i had to change the rotation to center the linetrace to centermass on target.

1 Like