ACharacter::K2_OnMovementModeChanged
#include "GameFramework/Character.h"
Access: public
Specifiers: UFUNCTIONBlueprintImplementableEventENGINE_API
Description
BlueprintImplementableEvent called when the movement mode changes, exposing both previous and new modes to Blueprint. This is the Blueprint-friendly counterpart to the C++ OnMovementModeChanged() virtual.
Caveats & Gotchas
- • In Blueprint, this appears as the OnMovementModeChanged event node (the K2_ prefix is stripped by the DisplayName metadata). Do not search for 'K2_OnMovementModeChanged' in Blueprint.
- • Unlike the C++ OnMovementModeChanged(), this event provides the NewMovementMode directly as a parameter, so Blueprint handlers don't need to query the movement component separately.
Signature
ENGINE_API void K2_OnMovementModeChanged(EMovementMode PrevMovementMode, EMovementMode NewMovementMode, uint8 PrevCustomMode, uint8 NewCustomMode); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| PrevMovementMode | EMovementMode | Movement mode before the change. | — |
| NewMovementMode | EMovementMode | Movement mode after the change. | — |
| PrevCustomMode | uint8 | Previous custom mode index, relevant only if PrevMovementMode was Custom. | — |
| NewCustomMode | uint8 | New custom mode index, relevant only if NewMovementMode is Custom. | — |
Return Type
void Example
Toggle a swimming overlay UI in Blueprint text
// Blueprint override of OnMovementModeChanged event:
// Branch on NewMovementMode == Swimming → Show underwater UI widget.
// Branch on PrevMovementMode == Swimming → Hide underwater UI widget. Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?