So i followed the tutorial from Unreal Engine 4 Tutorial - Simple Line Trace Weapon - YouTube by Tesla Dev and i got my weapon socket ready and such but when i try did a little event maker nodes for Single line trace " followed by Tesla Dev and when i play the project… it did not work well it seems when everytime i shoot my gun… The aim of where i shoot was very inaccurate.
Your problem is simple, your trace follows your weapon instead of your aim, quite logically of course. Solution: make your weapon follow your aim OR fake it and simply dont trace from weapon but from your eyes.
I would probably just add a second line trace if you need the projectile to come from the gun. So you do the trace in two steps.
First trace comes from the camera along the forward direction. Then you get the hit location of that trace, and use the hit location of the first trace as the direction to actually fire the weapon shot trace (tip of gun location - 1st hit spot normalized would be the direction).
Of course if you are just using a trace and don’t have a real projectile to fire, I’d skip the second trace and just have the trace come from the camera always. Then use VFX to make it look like the gun was the true vector. You can still use the location of the first trace to make a vector for the bullet trail fx.