Line trace in 2d going sideways?

Hi, i am trying to do a line trace from my weapon muzzle socket, this is in the motion matching sample- however i have converted it to be in a 2d side scroller so the camera only faces the side.

The line trace goes sideways and not in the correct direction it should- doesn’t matter if i change the muzzle socket direction or anything. Any clues what’s going on? Thanks in advance.


Its a line trace. It works in 3d.
If you want it to only trace in 2D you need to hard set one of the axis to the same number on both start and end vectors.

Probably, use forward vector * distance + socket position as the final trace point.

If you use the sockets own vector which is never going to be straight, a moving non-straight result is always what youll get.