A written tutorial I made on how to set up Enhanced Input in a C++ project for Unreal Engine 5.
This is my first written tutorial ever, so any feedback is welcome. And I hope it is educational for people searching for it.
https://dev.epicgames.com/community/learning/tutorials/9nm5/unreal-engine-enhanced-input-c
Great tutorial - I was able to find Enhanced Input with Blueprints guides, but for C++ this sorted me out quickly and laid down the foundational knowledge.
Thanks for producing this guide!
Wow, thank you. From the various docs and tuts for BP project, I was only able to get it 95% there, but your guide got it straightened out!!
Since you’re looking for feedback… here’s mine, which is mostly constructive criticism but I want to emphasize that I’m very grateful you made this…
-
Pick a target audience… For example talking about pragma is for noobs but glossing over details is for people who are familiar with UE. For example you say to create the MappingContext and InputAction but don’t mention where and how. Even “open the project in the editor” means nothing to newcomers. I’m only starting to get my bearings in UE so I’m probably extra sensitive to what is obvious vs not for newcomers.
-
Vanilla is best for tuts… I’m torn on whether talking about pragma or making the unneeded “UDataAsset” should be there. Pros and cons to fluff, it’s a balance
-
Excellent topic choice since it’s timely. With the old input being relatively recently deprecated, this new mess of files and config needs discussion!
thank you for this tutorial: it is condensed, short, precise. Better than any Youtube video I have seen on this
This tutorial is super clear and really good.
Thank you!
Thank you for taking the time to make this.
I had to make some tweaks to get this to work for me. I’m running on 5.1.1.
I needed to add “EnhancedInput
” to the PublicDependencyModuleNames inside of “*.Build.cs”
The Include paths that worked for me in the .cpp file:
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
I had to make some changes to the header file:
#include "InputActionValue.h"
public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
class UInputAction* InputJump;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly)
class UInputAction* InputLook;
Note the class
keyword infront of the UInputAction
Thanks again.
Thanks for mention the new #include. I have updated the post to reflect the new change. And also added explicit mention to add the Dependency Module to *.Build.cs file.
is it possible to apply the mapping context in the c++ code? I am using a custom player controller which means the pawn and controller are spawn at runtime and therefore cannot apply the a mapping contexts in BP like this tutorial and every other tutorial ive found has done.
This link is dead now?
Link is dead, any other source we could check?