UEnhancedInputLocalPlayerSubsystem::ClearAllMappings
#include "EnhancedInputSubsystemInterface.h"
Access: public
Specifiers: virtual
Description
Removes all active UInputMappingContexts from this player's subsystem at once. All input stops firing until new contexts are added.
Signature
virtual void ClearAllMappings() Return Type
void Caveats & Gotchas
- • Use with care — this removes every active context including any added by other systems (UI, vehicles, abilities). Re-add all required contexts after calling this.
- • Prefer RemoveMappingContext for selective removal. ClearAllMappings is suited to clean-slate scenarios like returning to main menu or level transitions.
Example
Clean slate before applying a new context set C++
void AMyPlayerController::OnLevelTransition()
{
if (UEnhancedInputLocalPlayerSubsystem* Sub = GetEnhancedInputSubsystem())
{
Sub->ClearAllMappings();
Sub->AddMappingContext(MenuContext, 0);
}
} See Also
Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?