I’m running Win10, VS2022, UE5.3.1. To replicate, I:
Create a project from the blank template.
Enable the VS integration plugin and restart.
Create a blank level, use the lighting window, 10x10 plane and a player start.
Create an APlayerController c++ class.
edit the build.cs file to include “EnhancedInput” in the PublicDependancyModuleNames
Let intellisense settle, try to type #include "EnhancedInputController.h" in the playercontroller class cpp.
It’s broken. Intellisense doesn’t see any “EnhancedInput*.h” and recompiling the code breaks if I include any of them. It seems this might be related to starting with the blank unreal project. I don’t know. I’ve been beating my head on this for a couple of weeks (and this is my spare time project).
Things I’ve tried:
Deleting a bunch of directories in the project that are regenerated by right-clicking on the uproject file and selecting rebuilding the VS files.
Putting EnhancedInput in the Private Dependancies instead (or both).
Narrowing down a small set of actions to replicate so I could post here.
TBH, the whole system seems rather “glitchy” when EnhancedInput is included in the build.cs file. Here’s a typical little snippet of the Unreal Engine Integration Logging:
[2023.11.04-20.20.08:811][ 0]LogInit: Display:
Execution of commandlet took: 0.34 seconds
Command finished with exit code 0.
Analyzing Blueprints - Success.
Running UnrealHeaderTool for "C:\USERS\DGILBERT\DOCUMENTS\UNREAL PROJECTS\UT\SOURCE\UT\UTOVERHEADPC.CPP"
Cannot find a valid build command in the project's active configuration. Stopping.
… I’ve even had it work for a spell … chucking these errors … only to crash and burn “later” after I’ve done more work. Here’s a shot of what intellisense says:
It is enabled by default. I have also tried disabling it and re-enabling it, but not in the detailed set of steps to reproduce above. Here is the plugins narrowed to input:
Well… as I understand the history, the EnhancedInput plugin was introduced in very late 4.x, turned on my default in 5.0 and is on it’s way (at this point) to being part of the standard. It could be this halfway integration that’s the problem, but I don’t know that.
Some of what I’ve read on the possible issue (from people having similar but not the same problems — or at least problems solvable by means that are not solving my problem — are that starting with the Blank project is required to trigger the problem. Others have had the EnhancedInput tag in their Private array rather than public. Heck I even tried having it in both.
I’m kinda hoping that someone who knows how this build process works can weigh in with a solution. If including those includes works for you, if you didn’t start with the blank project template, I have good reason to believe that you’re not experiencing the bug.
I created a blank 5.3.1 project built from source with Enhanced Input plugin enabled Win64 development target and with the EnhancedInput module included in the public dependencies, this compiled fine:
#include "MyCharacter.h"
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
// Called when the game starts or when spawned
void AMyCharacter::BeginPlay()
{
Super::BeginPlay();
if (APlayerController* PlayerController = Cast<APlayerController>(Controller))
{
if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer()))
{
GEngine->AddOnScreenDebugMessage(0, 5.0, FColor::White, TEXT("EnhancedInput"));
}
}
}
My build.cs:
// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class TestProject : ModuleRules
{
public TestProject(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" });
PrivateDependencyModuleNames.AddRange(new string[] { });
// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
}
}
Frustratingly Not what I’m seeing here. In my current instance, it was compiling with no code using the includes. Because of what I want to do, I’m adding two new includes to the CPP file… InputAction and InputActionValue. They both get the same treatment — they compile even… no errors. Then, when I add the following lines:
You have a typo in your UPROPERTY specifier, should be EditDefaultsOnly instead of EditDefaultOnly
Visual Studio will give a lot of “fake errors” in the Error List if you have one like that already, I find the output log more useful when attempting to run a build and it doesn’t succeed after fixing typo I would share that
You have another typo
it should read EditDefaultsOnly in the uproperties.
Also categories throw an error when you use single quotation marks, use double
…Category=“Player Input|Character Movement”)
I’ve typed this in so many times to try different ways to stop the errors … I’m sure I’ve made those changes before… but here we go… corrections made, recompile everything, fail.
a) Check that you are running vs as an administrator
b) Check if your Documents folder doesn’t have any write protects that may be interfering with the compile process (maybe try moving it out of “c:\users\dgilbert\Documents”)
c) Try validating your engine in case any files are corrupted.
d) Extract my project to another drive and see if it compiles.
e) You can also try compiling from the binary version of the engine to see if you get an ok for the editor build.
f) Probably a rare problem but check available disk space. Perhaps unreal chokes at low HD space (seeing as it has problems reading generated files)
a) I’m more of a unix guy, so I don’t know an easy canonical proof of Admin login, but I’m the only user and I can launch an administrator CMD shell.
b) That would be odd, and should effect more things. Testing it on my scratch drive doesn’t reveal anything working better.
c) in progress.
d) it compiled, and doesn’t act strangely
e) it fails … although this is hard to do as the engine won’t launch unless I roll back the changes and compile.
f) 500G free on 2T (C) Empty 8T scratch disk (G)
Also… on permissions:
C:\Users (everyone read and search)
… and above C:\Users (dgilbert, Documents, Unreal Projects) “full control”