How to make Line Trace in mouse location direction?

I’m creating an isometric shooter, and I’m trying to make a line trace come out of my muzzle socket in a straight line in the direction my mouse cursor is. I’ve tried several ways and it doesn’t work.

This is my character rotation on mouse location, its working fine

And this is the shooting projectile event

This is the result I got, notice that my character is pointing to one point but the line trace went to another

image

just to add, I have made a change that almost works, but it seens the line trace ends exactly on the mouse hit, and ends in the floor, but I want the line goes further like a bullet.

just add this part

and now follows my direction, but as I said, the line ends on the ground
image

Don’t use the mouse cursor position for the weapon shot. Use the start position of the weapon and it’s forward direction.
I added a project showing it in action (left click walk, right shoot)

1 Like

you dont need to subtract ActorLocation from the hit result, just plug Hitlocation straight into MouseWorldLocation

1 Like