Download

Unreal Cowboy Demo with cross-hair aiming - How ?

Hi,

Generally speaking it is a third person camera setup with aiming animations. I´ve been also following Tesla´s Twich Stream Game Development (third person “GTA style”) tutorials.

If I move the mouse around, the character follows the movement with the weapon (AimOffsets) and this is a nice effect, but I was wondering how to implement an aiming cross-hair so that the player knows what he is aiming at.

Can anybody please tell me how to set up third person aiming with a crosshair or point me in the right direction? I haven´t seen any tutorials about this.

Thankful for your help,
Michael

For my project, I draw a “Crosshair” widget in the center of the screen and do a line trace from that location forward to figure out where my “hit” point is, here is a screenshot of my widget, and the blueprint to make it show up on the screen.

8b3acae9c28690238ac3048d574e95a70418ed1f.png

83c67fd0b4effc9e10d7ec243c5e9886b5e16b83.png

Here is what the blueprint for firing the weapon looks like - you can ignore the “Calculate Spread” node, its a small function to randomize the hit point of automatic weapons:

fire.png

Once I get the hit location, I can add additional logic for adding damage to players, spawning particle effects, adding bullet decals, etc.

And for reference, here is what this looks like in motion.

Hope this helps!

Wow, thanks a lot for your help. I hope I find the time to try it out this weekend. :slight_smile:

EDIT: So simple :slight_smile: . Works, thanks again!