Firing at Offset (Not Centered) Crosshair (3rd Person)

(This is how I setup my last example) First, your reticle image isn’t located at (0,0) because it’s not in the top-left corner (where (0,0) is at). Second, you need to set the image’s alignment to (0.5,0.5) to make the center of the reticle the origin. This will make the position of the widget the center of the reticle.

Then in blueprint (though, you can also do this in the widget), you set the widget’s position directly using a variable & “Set Position In Viewport”. This makes “getting” the widget’s position easy because we already have it stored as a variable (i.e. we don’t need to get the widget’s position, just use the variable).
image
Same picture from my last post

The reason I chose this way is because the setting positions is perfectly accurate to the pixel.

Then, in your third picture, you need to push that point forward using the direction just like you did here:


But this won’t solve your main problem:

In that case, you need to first trace from the camera/reticle to the world, and wherever that point hits is where the character aims. Then, when you shoot, the gun trace goes from the character’s gun to that point. That way, the character always aims at what the reticle is on.


Obviously, you only want to aim at it if it’s in front of the character.

1 Like