3rd person + 1st person crosshair

How do I add a crosshair such that when the I’m in third person mode it should be a third person crosshair and when I switch to first person mode the crosshair should change to a first person crosshair?

Call Set Brush from Texture on your crosshair image in the widget, specifying the new crosshair texture when you change the camera view.

How exactly do I do it?
I’m sorry I’m new to this.

Here is the simplest implementation.

Pawn:

Widget:

In the select node, set your crosshair textures.

Thank you. But what is Image_45 variable? and HUDWidget?

Image_45 is a reference to the image in the widget (name was generated automatically).

HUDWidget is a reference to the widget with your crosshair, which is drawn on the screen.

The type of the variable must be a reference to the widget of the corresponding class.

I understood this part Thanks. Now, how do I add it to the Third Person character?

You need to create two camera components in your Pawn.
One for the first person, the other for the third (it can be secured via spring arm).
Then deactivate one camera and activate another to change the camera view using the Set Active function.

Or you can use one camera and change the position relative to the character. This way the change can be turned into a smooth animation.

I have added camera switch function in the third person blueprint. Just adding the crosshair is a problem. If I add a crosshair it’s on the head of the character (in third person view) but it’s working perfectly in first person view.
I guess I understood the issue. So the issue is that the crosshair is at a “x” distance from the camera. So in first person view the crosshair is at “x” distance from the camera which is perfect. But in third person view the crosshair is also at “x” distance from the camera which is the head of the character so the crosshair is on the head of the character. so I guess I have to increase the distance of this crosshair only from the third person camera but the distance from the first person camera shouldn’t change. How do I do this?

In many games, when you aim in third person, the camera moves to the side (behind your shoulder), then the character will not obscure the crosshair.

When moving, the camera can be strictly behind the character.

This is what I get

When I use this:

Move the camera relative to the spring arm

Result:

It’s working now. Thanks a lot.
And sorry for the trouble though.