How to make a turret on a vehicle to always be align at the crosshair?

I been trying to figure out how to make a turret from a vehicle align to the crosshair and i been having difficulty


this what i’m trying to do make the turret always look at the crosshair, I’m new to this and i haven’t found any tutorials on this

I’ll give it a shot at this. If I was trying to do that, I would convert the crosshair from 2d space to 3d space (the crossair points at the infinity from the camera).
After you have that point you have a direction vector you can use to rotate the cannon.

You would have to point the cannon to:
Cam pos + cam dir * big number

Does this make any sense? Maybe that math is all wrong…

i think i got it to work i use this blueprint

and use this one to lock the mouse on the center

now the problem is that when i posses the pawn of the helicopter it no longer tracks the mouse position

You already got the center point of screen(screen size divided by 2). No longer need the mouse position. Use ”project screen to world “node to get the world vector. And for direction use camera forward vector.