Why inputs may not work for a character

Hello,
I’ve faced an annoying issue with input action. They are not working for my new character, but everything is working good for character from First Person template. Could someone help please?
What I did so far

  1. I create C++ FirstPerson project.
  2. I created new GameMode with new Default player pawn.
  3. I added keyboard event for A in pawn Blueprint.
  4. Inputs are enabled at begin play. Look at the screenshot
  5. I also have several levels at this project. At a place where my inputs supposed to work, I opened new level before this.

I really don’t understand what I’m missing here. Enhanced inputs also don’t work for my new Pawn(It is the main reason why I started to experiment with A keyboard event from the screenshot). I checked it a lot of time with character from FirstPerson Template. They are same, but mine doesn’t work.

Help please. Any ideas?

You should also assign the input mapping context either with C++ or blueprints like this:

You can also place this after Begin Play, doesn’t matter in your specific case. (same goes in C++)

Hope this helps! :innocent:

1 Like

yes what @VisAgilis said,
and also you have to either set “default pawn class” or “possess” the character (possess on beginPlay).

1 Like

I think OP has a C++ class Game Mode so the default pawn can’t be set from the editor. I assumed it was set with C++ but yes, you’re right that he should also make sure of that.

Oh and @TeryKnop, also make sure to focus on the PIE window otherwise your inputs won’t be registered. Wanned to add that as well just in case :wink:

2 Likes

@VisAgilis @hadenep big thanks for your reply. Actually, everything what you are mentioning, looks like is correct in my code. I’ve found out that my issue is a bit tricky :slight_smile:

I have already done my splash screen widget and other menu widgets. When I start my game, I launch Set Input Mode UI Only node in my widgets. It blocks any inputs by the way. I’ve figured it out debuging C++ platform. Function FInputModeUIOnly::ApplyInputMode(..)

So, if you are using Set Input Mode UI Only from widget to widget or wherever, don’t forget to turn it off launching Set Input Mode Game Only or Set Input Mode Game and UI Otherwise, inputs will not work for you!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.