I’ve defined my UInputMappingContext and my UInputAction(s). I’ve done my binding and everything works great.
Using the Editor I looked at creating a Context and an Action and noticed that the Context and Action both allow you to define Triggers. Why? I’m trying to think of a case where this makes sense. Plus I don’t see a way in C++ to add the triggers to the BindAction. I’m assuming the answer for Triggers would also apply to Modifiers.
One scenario I was thinking of, was my character is going to cast a spell that has a power-up feature. The player presses the button and holds it, when released the spell fires.
Pressing the button would start the spell and display the power-up bar.
Holding would cause the power-up bar to update on some time frame.
Releasing the button will cast the spell.
My first instinct is to create three functions for the actions. Since only the BindAction assigns a function. I’m thinking BindAction would use the same action, but I would use the ETriggerEvent::Started for StartSpell, ETriggerEvent::Triggered or ETriggerEvent::Ongoing for PowerUpSpell and ETriggerEvent::Completed for CastSpell.
How would I do the same thing using the UInputTrigger variants?
I’m working in UE4.26 if it makes a difference.
Thanks
Mark