Can't get Player Mappable Actions

I’m trying to get all input in a mapping context in order to dynamically create a control remapping widget. But the corresponding nodes don’t return anything.

There is a mapping loaded and input is working. It’s just that I’m either using the wrong object for the interface call or that they are broken. Can’t find them when searching for documentation either.

EDIT: This is for 5.1 and 5.2. If you’re using 5.3+, go to this instead Can't get Player Mappable Actions - #11 by rokenrock


I actually just found out how to do this for my own project. The documentation for player mappable anything in this system is really poor. Took a while and was a pain in the ***, but I now understand it.

Here’s the post I made about it. It goes over the entire process from mapping to saving to loading to the little quirks of the system, including that node:

1 Like

I tried what you did but now none of my input works.

Maybe I got something wrong. Do you see the error?
It’s called on begin play

There isn’t anything obviously wrong. That’s really weird though- with your setup, it shouldn’t be possible to delete mappings.

Sometimes using Enhanced Input Local Player Subsystem is a bit jank, so maybe get a reference to player controller and get it from there.

I notice you’re not using an array of contexts. Which is fine if that’s not how you set up your game.

Make sure you have the defaults of InputConfigs set and never change them at runtime. Never change anything in them either. Preferably show me the declaration of this just so I can make sure.

Make sure you don’t have any MapKey or UnmapKey nodes hidden somewhere in a blueprint you forgot about.

Could you also show me your context(s) fully expanded like so:

1 Like

Alright, these are the places that use the mapping nodes other than initialising in the controller and trying to get all of the mappings in the widget.

I got these:

And the mappings are:

I don’t use an array of mappings yet as there’s only vehicle control now.

This is the player mappable input config:

There’s no changing ingame yet, but it’s going to happen at some point.

Ok-

  1. The array of contexts (or in this case single variable) is just a reference to every context in your game that will ever be active. It should never be changed


  2. Get rid of the player mappable input config. It’s stupid and I don’t like it and is only useful for applying multiple contexts at once.


  3. Make sure this function



    Has run before Init



  4. This function won’t work to get bindings- it’s from the old system, not enhanced:


    You can delete your old bindings under Project Settings → Engine → Input

1 Like
  1. Alright, thanks for clarifying!
  2. I deleted it
  3. I deleted the code behind Init. It never ran because this widget component wasn’t ever created because I never received any keybinding from the subsystem
  4. It’s deleted from Init
  • though I still can’t control anything when I use the loop to add the mappings with and I’m also receiving nothing from GetAllPlayerMappableActionKeyMappings -

I’m really grateful that you’re trying you best to help. Though do you have any idea left?
I could be creating everything by hand but I kinda don’t want to create stiff systems that are high maintenance whenever we change something :confused:

EDIT:
So this is what I do in the controller on BeginPlay:

And the Interface call to the HUD calls this widget function:

The array is always empty though and the breakpoint on the brnch never reached:

Of course- that’s the same reason I made it in the first place.

Though, this is likely unrelated to the binding. This function doesn’t actually change anything, it just applies the defaults that you’ve already made to a form that we can change and monitor.




You ARE applying the context right? If the context isn’t applied, though you can still change its bindings, the events for input will never fire. This is how the default first person character does it, but it’s fine as long as you’re activating that AddMappingContext node:

Also, ensure that input works at all. Maybe like so:

1 Like

Waaaaiiiit a minute…

I have to call both of these:

And THEN add the mappable keys like this!?

This would be really counter-intuitive

EDIT: It works… Oh lord. Thanks for pointing that out! Really helped me there!

1 Like

In case anyone stumbles on this thread: It was deprecated and currently makes sense only if you on 5.1 or 5.2.
https://www.reddit.com/r/UnrealEngine5/comments/16hywoj/why/
at 5.3+ you can’t access ‘Player Mappable Options’ structure.
image

Ah- right. I meant to update when 5.3 came out. Let’s hope they don’t change too quickly this time.

In more recent versions the process has been simplified to the point it barely even needs a guide, but in case someone’s reading to the bottom of this thread, here’s what you need to do to get the mapped keys:

  1. Make sure all your contexts are registered with the input settings object (ignore RefVPlayerController, that’s custom- just get your player controller)
  2. Get the current key profile, and from there get the player mapped keys
  3. With that, you can then find a mapped key and get the mappings from it. To actually do anything useful you’ll need to change it from a set to an array using the ToArray node.
1 Like