State 1: "get button down" action
Set up your shoot button in the input manager. I will just call it shoot for this example
When get button down detects that the shoot button has been pressed, transition into state 2
State 2:
optionally play shoot sound.
optionally create particle muzzle flare at gun
Find out the where the player is aiming (maybe using rotation from camera) and optionally add some degrees randomly to each axis to add some inaccuracy.
Raycast in the direction that you have determined using camera and random inaccuracy.
Mask the raycast to only detect 2 layers: Obstacles and Players (or enemies).
If raycast hits an obstacle, dont do anything and just transition back to state one and listen for shooting again.
If raycast hits an enemy, save the hit object as a variable, and transition to state 3
State 3:
use Send Event action
Target: your hit object variable (the enemy you hit)
Event to send: whatever you have on the enemy that makes it take HP away from itself
Then transition back to state 1 and listen for shoot button again
___________________________________________________________________
This is just a VERY basic example that should get you started. You could also add parameters to shooting like every time you shoot, rotate camera up a bit or something to simulate recoil. Anyway, this setup worked for me when i first started
Hope this helped. Good luck
-Koz