Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Shoot Down the Center of the Crosshair using LineTraceSingleByChannel

  • Unreal Version: 5.0.0
  • Template: First Person
  • Project Name: MyProject

Big credit to the Shooter Game Project. It's a wonderful learning resource. I just tried to split out the weapon instant fire trace code from the project and simplify it so I could better understand it.

Screenshot

this code is ignoring weapon spread

  1. update the HUD.cpp file so the crosshair is in the center of screen. The crosshair texture is 16x16 so I adjusted it by 8 units in each direction on line 28. I think it's purposely off-center in the template to be more aligned with the yellow projectile, but I'm really not sure I could wrong.
  2. MyProjectCharacter.h - line 143
  3. MyProjectCharacter.cpp- line 14, lines 144-169, and lines 302-321

Helpful Links