How can I synthesize a Fire action?

I’m trying to script game input, and I’d like to simulate the Fire action occurring. I’m just working with the first-person BP tutorial, and I can’t figure out how to generate an InputAction event that will follow the right flow. I’ve tried following the UPlayerInput::ProcessInputStack flow, but I’m pretty lost. I’ve thought about writing a custom input device, but all the examples I see there synthesize button presses rather than higher-level actions.

(I’d actually like to do this for movement events too, but I figure that once I get it sorted for Fire I can work from there.)

In more detail:

My understanding of the input pipeline is roughly this:

  1. operating system event is received (mouse click)
  2. OS event is converted to Unreal event (LeftClick)
  3. Unreal event is mapped to action (Fire)
  4. action is dispatched through the inputstack (actor, controller, level, pawn)
  5. “InputAction Fire” is triggered for each of these layers until one handles it

I want to basically create a Fire event and kick off step 4, so that it is then dispatched to the right handling component.

Do you have an animation blueprint that defines the fire event?

Is this for ai character or canned main character movement?

I’m just working with the BP first-person tutorial, which has the triggering of animation and projectile spawning triggered by InputAction fire. That’s the flow I want to trigger.

So if i understand correctly you are just trying to work out how to trigger an InputAction that calls a method within your class?

If you look at the tutorial for for third person C++ project, it covers input actions in C++ and triggering events

I’ll take a look at the tutorial, thanks. I want to trigger the InputAction in the pipeline such that the game takes the normal actions in response to it. Basically I think I want to do the same thing as whatever converts LeftClick to Fire in the input stack.

(Updated the question, possibly clearer now.)

Actually, I think this can be achieved in a blueprint by using a custom event.

If you create a customer event and have it trigger exactly the same execution branch as your fire event does, you can then trigger this event from anywhere in a blueprint and it will cause that execution branch to execute.