First person camera's forward vector not matching crosshair

Hi!

I’m using the First person template to test where is camera’s forward vector pointing to.

To know it, I have used a Line Trace:

A User Interface Widget with a Crosshair:

But it seems that the cross hair is not in the right place:

I need to put a cross hair where the camera’s forward vector is looking at.

How can I do it?

I forgot to include the world position of the camera in the world to the forward vector.

Use the actual rendered view, not the camera component transform, for this.

In the Player Controller:

1. Get Viewport Size and multiply it by (0.5, 0.5).

2. Feed that into Deproject Screen to World.

3. Line Trace by Channel with Start = World Position and End = World Position + World Direction * 7500.

4. Put the UMG crosshair in a Canvas Panel with Anchors (0.5, 0.5), Alignment (0.5, 0.5), and Position (0, 0).

This keeps the trace aligned with the crosshair even if the active view differs from the camera component. If you only need the camera ray, use Player Camera Manager → Get Camera Location/Rotation and its forward vector.

Just want to add that you should be using Base Aim Rotation and the Camera Managers Camera Location if you intend to do multiplayer.

Simplified version…

Interface based variant

Use a macro to call the interface and return the vectors.