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:
operating system event is received (mouse click)
OS event is converted to Unreal event (LeftClick)
Unreal event is mapped to action (Fire)
action is dispatched through the inputstack (actor, controller, level, pawn)
“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.
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.
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.
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.