How do I enable Enhanced Input in a blueprint task?

Hopefully this is simple to answer, but how do I enable Enhanced Input in a blueprint task?

I’m using Behaviour Tree for a dialogue system and would simply like to skip dialogue when I press a button like so:

Currently I have it set up like this:

This kinda works, but ‘Get Last Fired Input’ seems to have a several second delay before it recognizes the next button I press. For example, if I move the right thumbstick on my controller it thinks I’ve pressed the skip button, but if I wait a few seconds then move the thumbstick it doesn’t skip.

Edit: Just for extra context, the button to initiate dialogue with an NPC is the same button used to skip dialogue.

Is there a more obvious solution other than enabling Enhanced Input to trigger the Finish Execute node?

Okay so this works:

Would still like to know whether it’s possible to enable enhanced input events in a blueprint task, but for now at least I can move on with this.

Hey @Knuthnads,

To fire directly inside the blueprint, you will need to enable the input using the enable input variable referencing your controller. If you are interacting with your character, I would highly suggest using a blueprint interface instead.

image

Let me know if this works for you!

Hey @Knuthnads,

Checking in! Was the above the solution you needed?

I wasn’t the OP but I was searching for the same thing as them, and after testing it, that won’t work in a blueprint task specifically because “enable input” only works on actors, not behavior tree tasks.

Your recommendation to use an interface did solve the issue for me though! Here’s how I got the result I wanted using an interface instead of directly-implementing input in the task: First I set up an interface with a function called “Dialog Response” with just a generic “object” as input. I assigned the interface to both the behavior tree class and the first person character class where I have all my input handling.


Then in the behavior tree class I got the player character and called the Dialog Response (message) function I just created in the interface, using a reference to self as the “current task.” For simplicity, I implemented the same event on the graph below, and hooked it up to the action I want the enhanced input to trigger.


Next in the first person character blueprint, I implemented the interface event and promoted the “current task” object input to a variable. Then I added an event for the enhanced input key I want to use, and went off the “started” pin so each press would only trigger one task. I validated that the variable wasn’t empty and called the interface event back at the dialog task, clearing the variable afterwards.