// Fill out your copyright notice in the Description page of Project Settings. #include "DDIPlayerController.h" #include "EnhancedInputSubsystems.h" #include "Engine/LocalPlayer.h" #include "InputMappingContext.h" void ADDIPlayerController::BeginPlay() { Super::BeginPlay(); if (UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem(GetLocalPlayer())) { for (UInputMappingContext* CurrentContext : MappingContexts) { Subsystem->AddMappingContext(CurrentContext, 0); } } }