Hi, I’m trying to add the Enhanced Input System to my code, but I’m having a problem.
I can call the functions necessary in Blueprints because it appears in the context browser, but when I try adding the necessary code to set up the process in C++ nothing appears.
I’m trying to add the following in the BeginPlay() function:
`
void ARobotCharacter::BeginPlay()
{
Super::BeginPlay();
if (APlayerController* PlayerController = Cast<APlayerController>(GetController())
if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController))
Sybsystem->AddMappingContext(MC_Controller, 0);
}
`
The error I’m encountering is that for some reason I can’t call the UEnhancedInputLocalPlayerSubsystem class or its functions.
Thanks for the help. I recently had the same issue again but this time is because I forgot to include the header XD. But thanks, forgot to mark it as the solution.