What is wrong with enhanced inputs? They only work sometimes.

Hi, can anyone please tell me why enhanced input mappings work only when they want to?
If I just call a keyboard event, it works flawlessly. Enhanced input mappings, not so much.

Are you sure you added a mapping for inputs and added this kind of script in your pawn ?

1 Like

Yeah, I have that in my first person character. But I added an actor component in it, and I’m trying to run an input action event in there. Do I have to put that code in the component as well?
What about other pawns?

You mean in Project Settings? Yeah.

For other paws see Does enhanced input work with any actor? and I mean in your context here :

1 Like

What I usually do is have the player (or playercontroller) call the event FROM the actor component, using the enhanced input.
The input’s on the character BP but the event is on the actor bp. Just use Validated Get-> ActorBP->AsActorBP_CustomEventOrFunction

1 Like

I have just an input action event with a print string in my player character blueprint, and it still only fires a few times while I spam the key.

This is my setup. Project settings:

The input action file:

The mappings:

Okay, I’m seeing some things I would definitely change for a single-press UI opening situation. Try these changes and see how it works out for you!

1 Like

Thanks, I made the changes but there’s no difference. Actually it seems a bit worse now.

Wait… How are you tracking this?

You need to make a counter. An int variable, that when it’s pressed it does ++ then Prints itself. Then press the button 10 times really quick or whatever. If it’s just printing hello and that’s going away/reupping we need something a lot more precise… You don’t have to do it this way but we need SOME kind of permanent tracker.

1 Like

You mean like this:

Still nothing.

What do you mean nothing? Like it’s not going through at all? Because from what I understood it was missing some of the time, not all.

If it’s missing every time, we need to focus elsewhere. If it’s only missing some of the time, what’s the behavior it’s giving? This is meant to give better details for testing.

1 Like

I mean I spammed the key for about 10 seconds and I only got one print on screen.

Try with Started instead of Triggered on this

1 Like

That’s insane. I have no idea what’s going on with your thing- I’ve only ever had to do stuff to make it slow down, never speed up! A couple of things:

Try “Delay until next frame” if you’re having a low framerate, if it’s activated on a skipped frame possibly it’s lost? That’s a guess but I’d try it.
When testing, type “debug EnhancedInput” into the console (use the “`” key, far left of the numbers on your keyboard).

1 Like

Hey @AllGamesSuck! Did you get it figured out? Let us know what you did!

1 Like

I changed my keyboard and it works now. For some reason, the old one wasn’t working with enhanced inputs well. But, like I said, it worked fine with simple keyboard events. :person_shrugging: