Mover Shared Settings

Knowledge of Unreal Engine 5.

logo unreal
A

Author

Author

Created: May 08, 2025Updated: Apr 14, 2026

Table of contents

Introduction

Mover is modular and data-driven. Each movement mode can contain relevant settings that are only used for that mode and exist within the movement mode instance itself.

However, in general, multiple movement modes may also share some settings.

This section mainly discusses the relationship between movement modes and shared settings, as well as the principles for creating and using shared settings.

Configuring Shared Settings

Each movement mode can specify the required type of shared settings in itsSharedSettingsClassesfield, and when you finish editing theMovementModes, theMoverComponenton theSharedSettingsarray will automatically refresh based on the configuration ofMovementModes.

If there exists a certain type of setting that is not used by any movement mode, it will be automatically removed from the array.

You can check theUMoverComponent::RefreshSharedSettings() to understand the specific logic.

Using Shared Settings

Each movement mode can implement OnRegistered and OnUnregistered, and at this time, it can obtain the corresponding shared settings through the MoverComponent and cache them for use in other logic under that mode.

cpp
1 TObjectPtr<const UCommonLegacyMovementSettings> CommonLegacySettings;
cpp
1void UWalkingMode::OnRegistered(const FName ModeName)
2{
3 Super::OnRegistered(ModeName);
4
5 CommonLegacySettings = GetMoverComponent()->FindSharedSettings<UCommonLegacyMovementSettings>();
6 ensureMsgf(CommonLegacySettings, TEXT("Failed to find instance of CommonLegacyMovementSettings on %s. Movement may not function properly."), *GetPathNameSafe(this));
7}
8
9void UWalkingMode::OnUnregistered()
10{
11 CommonLegacySettings = nullptr;
12
13 Super::OnUnregistered();
14}