Key press event not triggering

Background - I simply want to execute an event (called “Perform Event” here) when I press the “T” key - that calls an event in a BP related to an actor class (this is using the default player controller as it’s actually not taking any direct user controls - it’s a set and forget game):

I have enabled input into the BP (during event Begin Play):

I added a keyboard binding in Project Settings > Inputs:

I made sure that the Actor Input was set to receive inputs from Player 0 (my default):

330140-capture-event4.jpg

I am using a custom Game Mode that handles everything else - but there is no “player controller”… instead I utilise the default player controller for “floating around the world” rather than controlling a specific actor/character.

Problem: It still doesn’t do anything when I PRESS THE T KEY! It’s driving me insane. I have gone through all the online help/google searches, and haven’t found anything. I am sure there is something that I’m not including, or some minor switch - but for the life of me I can’t find it.

Guess: I am assuming that something is consuming the keyboard event - though I have gone through all the other BP and haven’t seen anything. I am amazed that there is nothing in UE4 that lets you see key binding events by BP.

2 Likes

The only other things I can think of are:

  1. Did you place an instance of the actor in the level?

  2. Try using a different key. It’s possible you have another actor consuming that key.

You should have an “InputAction Initiate_Event” node. Notice that Initiate_Event is the name you gave this action. Replace the T Key node with this node and it should work.

Does it work in a fresh project?

Did that already - actually that was on the diagram (was just renamed to make it clearer in the key binding - but I forgot to redo the screen shot. So that didn’t work unfortunately.

Yep - actor in the level, and tried a number of different keys.

Problem resolved (if not solved). I had a NPC vehicle in the game for which I had created my own controller. Unfortunately, this controller was extending Player Controller, not AI Controller. It turns out this one actor was stopping the inputs from propagating. Re-parenting as an AI Controller fixed the problem. This is despite there being no obvious input blocking, or events being consumed by the NPC. Would be great if someone could explain why this would be a problem… as the input was still enabled to the original BP, and as far as I could tell it should have worked.

Any explanation?

I was able to re-parent my class ok - so can work in the current project (and I assume a new project) - with all input events being reacted to. It’s an annoying error on my part, and perhaps one I could have anticipated. Just think it’s worthwhile keeping a record of it, because it may be the sort of thing that others do (maybe?)