if (APlayerController* PlayerController = Cast<APlayerController>(GetController()))
{
if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer()))
{
Subsystem->AddMappingContext(DefaultMappingContext, 0);
}
}
This code is called in BeginPlay but it does nothing. If I do the exact same thing in the Child Blueprint of the class, it suddenly works. I did all the necessary steps to include the enhanced input system, but it won’t work from C++.