I’m trying to write the logic to allow a player to change key bindings in game. But When I include “EnhancedInputUserSettings.h” in my .cpp file, I get an error saying that I cannot open the source file. Does anyone know what this means and how to fix it?
The documentation states that it requires the module “EnhancedInput”. You need to add this to your build file in the dependencies for it to be found in your project’s files.
Documentation
To give a little more context here, if code lives within a module (or plugin, they are pretty similar) - it means your project won’t be able to access it unless you add that module to your projects module dependencies. The build.cs file is where you list these dependencies.
This is often identified as the compiler telling you the file doesn’t exist or it can’t find it. That’s because your project hasn’t been told it can “look for files” within the module. By default your project will just look for files within your project or unreal engine’s engine code.
I have that. Here’s what my build.cs says:
PublicDependencyModuleNames.AddRange(new string { “Core”, “CoreUObject”, “Engine”, “InputCore”, “UMG”, “EnhancedInput”, “FMODStudio” });