Best way to implement a basic tap to shoot system?

I’ve attached some professional drawn concept art.

What I have so far is a third person character with an aim space. From the view point of that character’s attached camera, I can tap anywhere on the screen causing on explosion by using “LineTraceForObjects.”

Now I want to have my character physically move his arms (using the blend space) and shoot wherever I tap on the screen (assuming I tap somewhere in front of him, but I’ll figure that out later). Not sure how I should approach this. I can think of some ideas but it gets really complicated really fast so I’m hoping there’s a somewhat elegant solution to this.

maybe have a look at the aim offset tools:
AimOffset

yes that’s what I have working, I can get the character to aim wherever I want with the mouse, now I just want them to aim wherever I tap on the screen and then fire

Thanks, that really helped simplify my code.

Where I’m having trouble is how I can tell if my character is aiming where the user touched. For example, let’s say my character is facing a door and already aiming at the door, if the user touches the door, how will I be able to check that the character is already aiming at the door?

One idea I’ve had

  • In my character I could do LineTraceByChannel => Break Hit Result => Location, and compare that to where the player touched.

For example, let’s say the user touches at the point, (0, 5, 0)

And I do a line trace of where my character is aiming right now and it returns the result (1, 1, 1)

I could adjust the player’s aim point accordingly until they’re aiming at the point (0, 5, 0).

However this seems like a really inefficient way to do it since I’d be calling LineTraceByChannel a lot.