AddInputMappingContexts
Apply multiple Input Mapping Contexts.
AController* PlayerController = GetPlayerController();
TArray<FUDCoreEnhancedInputContextData> Contexts; // Fill with the desired contexts
bool bClearPrevious = false;
EUDSuccessStatus ReturnValue = UUDCoreInputFunctionLibrary::AddInputMappingContexts(PlayerController, Contexts, bClearPrevious);
Inputs
The player controller to add the contexts to. Will attempt to get the LocalPlayer from the controller.
Contexts
TArray<FUDCoreEnhancedInputContextData>
required
The contexts to apply.
Whether to clear all previous contexts before applying the new ones.
Outputs
Returns Success if the contexts were successfully applied.
RemoveInputMappingContexts
Remove multiple Input Mapping Contexts.
AController* PlayerController = GetPlayerController();
TArray<TSoftObjectPtr<UInputMappingContext>> Contexts; // Fill with the desired contexts
EUDSuccessStatus ReturnValue = UUDCoreInputFunctionLibrary::RemoveInputMappingContexts(PlayerController, Contexts);
Inputs
The player controller to remove the contexts from. Will attempt to get the LocalPlayer from the controller.
Contexts
TArray<TSoftObjectPtr<UInputMappingContext>>
required
The contexts to remove.
Outputs
Returns Success if the contexts were successfully removed.
SwapInputMappingContexts
Swap a designated Input Mapping Context with a new one.
AController* PlayerController = GetPlayerController();
TSoftObjectPtr<UInputMappingContext> PreviousContext; // The context to swap out
TSoftObjectPtr<UInputMappingContext> NewContext; // The context to swap in
int32 Priority = 0;
bool bUsePreviousPriority = false;
EUDSuccessStatus ReturnValue = UUDCoreInputFunctionLibrary::SwapInputMappingContexts(PlayerController, PreviousContext, NewContext, Priority, bUsePreviousPriority);
Inputs
The player controller to swap the contexts on. Will attempt to get the LocalPlayer from the controller.
PreviousContext
TSoftObjectPtr<UInputMappingContext>
required
The context to swap out.
NewContext
TSoftObjectPtr<UInputMappingContext>
required
The context to swap in.
The priority to set the new context to.
Whether to use the previous context’s priority when adding the new context.
Outputs
Returns Success if the contexts were successfully swapped.