Keybindings in Blueprint, without Plugins

I found a very simple solution for Keybindings, without the need of a Plugin. (I know that there is such a plugin, but i did not want to use it.)

It might not be the fanciest solution possible, but it is easy to use and compatible with every Version of UE4 that has the Nodes that i used in Blueprint. (Plugins can be troublesome if you switch engine versions and the plugin gets outdated.)

What you need:

  • 1 Variable (Key) for every Key you want to rebind [WASD and SPACE in this Example]
  • Events that trigger the Movement-Input

Then you do this:

and this:
UE4_Keybindings_2.PNG

Done!
You can now rebind your Key-Variables from anywhere.

It can easily be enhanced for 6 DOF or anything else. (I am using it for 6DOF and normal FPS-Controls in the same game, without any problems)

Thanks to share @Yaeko :slight_smile:

I was just wondering, he supports controller/gamepad?
I means, not keybind the gamepad input, only keybind the keyboard, but if I plug a gamepad I will be able to move my character around.

And again, thanks to share.

I can not test it, since i do not own a controller.

BUT i think it should work… i do not see any reason why it should not work (you just need to plug in your controller-values into the event // alter my approach a bit).

I did! Its not pretty, its ugly, but works xD
I tested with a PS4 controller using the DS4Windows to emulate a Xbox controller, but probably works with a Xbox controller :slight_smile:
BP below, now need just ad a umg to change/save/load the variables “Key …”

If anyone know how improve this, please share :smiley:

Thanks @Yaeko o/

This is exactly what i had in mind when i answered to you.

I also do not see many room for improvements, since this is already the most minimalistic and easiest way to achieve Keybinding that I have seen.
It is a bit “dirty”, but who cares, if it works… it aint stupid. :P.

No problem, took me whole night to find this workaround, decided to share it with everyone because this is a common question for Blueprint-Only games.

Can we get this into the wiki - at least until Epic decides to put in actual support for keybindings in Blueprint?

You can feed everything into the System that you can press, regardless of the type of input. (even VR should work, but would not make much sense)

I only provided the basic idea, since everyone has different needs.
If you need more functions, you can easily add them, but i will not add them here… just to keep it simple enough that even newbies can replicate it.

just store them in some actor that will never be destroyed, easiest way. (or simply do not destroy your pawn >.<… i just move them to where they need to be after loading.)

Hi Yaeko,

Awesome Tutorial. I’m interested in your take on implementing Co-piloting Keybinding? We have a discussion going on about it over here. But, in a nutshell, the copiloting allows two players to share the same character controller, with bindings to separate keyboards/mouse/gamepads.

I personally can see the control scheme being useful in many game genres, especially Horror Games and controlling larges ships/crafts/giant robots. Ultimately, I think its a quick way to get a local coop multiplayer experience operational with nearly no effort, allowing two or more players control a single character.

Wouldn’t it be the easiest way to just “Cast” to the pawn they control? (My Keybindings/inputs can be casted, if done right.)

But maybe this needs a hidden “pawn” that can fire these events to the pawn they actually control.

Should be possible, but i have never tried stuff like this.