Verify if player arrive at location

To break it down, this is the data you have.

MouseLocation: A screen space (X, Y) value that represents the 2D pane you can draw a UI to.
TargetLocation: World space( X, Y, Z ) value that represents the 3D “game” space where 3D assets can be rendered.

The difference between the MouseLocation and the TargetLocation is the Z, which is what GetHitResultUnderCursor( ) will convert to. It does this by taking MouseLocation (X,Y) and converting it into World Space ( called a Deproject ) and then it will run a Trace from the direction the camera is facing by a default value of 100000.f cm. If this trace hits any object that matches what you passed into the GetHitResultUnderCursor( ) function, it will give you the FHitResult with the data of that trace.

Now, when it comes to your player not reaching the exact location you pressed. This is normal. It is very difficult (really impossible) to always land on the exact position calculated, which is why this code works:

if( (GetActorLocation( ) - LastWorldMouseLocation ).Size( ) < 128.f )

This is essentially saying, if the distance between the character and the world mouse location (the hit result from the trace which was converted from your left click / touch position on the 2D screen space into 3D world space) is less than 128.f cm, it is close enough to say the player has reached that spot. Again, this is not exact. This is a variance of a 128 cm of reaching the exact location that was converted from your touch / left click location.

Lastly, I still don’t know what your goal is. Is it just to left click on the screen and move the character to the world space under the click? If so, you should look at the Top down template or just duplicate the code above.