Movement Control Settings

The documentation of Generic Game Framework.

Cover.GMS
A

Author

Author

Created: Apr 20, 2025Updated: Apr 14, 2026

Table of contents

Movement Control Settings

GMS_MovementControlSetting allows you to configure movement/rotation settings for multiple different movement states, achieving different speeds and control feelings in various movement states.

Creating Movement Control Settings

运动控制设置.创建

You can create a new movement control setting by creating a data asset of type GMS_MovementControlSetting in the editor.

Adding Control Settings to Movement Set Settings

GMS provides a wealth of pre-configured movement control settings. Here, we will use MC_Normal.

GMS运动控制设置.026

Note

If you are a heavy user of overlays, you may also want different OverlayMode to influence control. You can add mappings between different OverlayMode and movement control settings in the ControlSettings map. For a specific OverlayMode, if there is no corresponding valid control setting, it will fall back to the default control settings.

Movement State Settings

A movement control setting can contain multiple movement state settings (MovementStateSetting).

For example:MC_Normaldefining common movement states: walk, run, and sprint.

运动控制设置.移动状态

Note

A movement control setting requires at least one movement state setting, and this array should be sorted by speed from lowest to highest.

Each movement state setting can specify its movement speed, level, acceleration, deceleration etc.

Rotation Modes

GMS provides two default rotation modes by default:

  • RotationMode.VelocityDirection: The character always faces the movement input direction (which could be player input or the direction of a certain velocity).
  • RotationMode.ViewDirection: The character always faces the view direction (i.e., towards ControlRotation).
运动控制设置.旋转模式设置

For different rotation modes, GMS offers multiple implementations. You can switch between different settings in the paired project to observe the differences.

For C++ Users

The settings corresponding to different types of rotation modes are implemented using InstancedStruct. In the code, different processing logic is applied based on the specific struct type.
You can follow the same pattern to add new Structs and new rotation handling logic.

Extension

Since movement control settings are data assets, you can also inherit from the default MovementControlSetting to add additional setting fields, and then select your customized movement control settings in the movement set setting.