Gameplay Guide

Gameplay Guide
Usually, in your game code, you will perform the following operations through the movement system:
Switch Movement set

Use Case: Each set of animations can represent a movement set. Then, in the game, you can switch between different movement sets based on weapon changes.
For example, if I am currently in the "Sword Non-Defense" movement set and I press the right mouse button, I switch to the "Sword Defense" movement set. At this point, my movement/control methods and animations change to those set under this movement set. When I release the right mouse button, I return to the "Sword Non-Defense" movement set.
Adding/Removing Movement Definitions

You can use a small number of MovementSet
tags and combine them with this api to make MovementSet
polymorphic.
In the GMS project, the default movement set tags are MovementSet.Default
, Crouched
, ADS
, and ADS_Crouched
. Each movement definition is also configured with movement set settings corresponding to these tags.
Therefore, you can push/pop different movement definitions based on your game logic (e.g., weapon switching) to replace different movement set settings.
In the GMS example, switching between male and female characters not only changes the mesh but also dynamically replaces the movement definitions specific to each gender.
Switch movement state
Movement state refers to walking, running, sprinting, etc.

In addition to manually setting different movement states, GMS allows you to dynamically adjust different movement states based on the Actor's actual movement speed (thus applying different control and animation settings for different movement states).
For example, for NPCs, by adjusting the external speed of the NPC, GMS will automatically match the closest control/animation settings to that speed.
The reason movement states use GameplayTags
for identification is that certain characters may have more or fewer movement states under specific movement modes. By using GameplayTags
, you can more easily add new movement states.
Switch rotation mode
In the game, you will also switch the rotation mode. If a character enters the aiming state, you also want to switch its rotation mode to ViewDirection. This is the most common usage.

For example, in the combat system: if you lock onto a target, the rotation mode should switch toViewMode
; if you unlock the target, it should revert toVelocityMode
.
For ranged weapons: when you hold the right mouse button, your rotation mode should be set to ViewMode
.
Character Orientation Control
GMS has its own rotation system, and Character will be rotated in different ways depends on what movement control settings the character is using.
If the LocomotionMode is Grounded and InAir, the Character will face the Velocity direction when the rotation mode is VelocityDirection, and will face the ViewDirection when the rotation mode is ControlRotation. If the rotation mode is ViewDirection, the Character will face the direction of ControlRotation.
AI Orientation Control
When you want to manually control the orientation of an AI character, you should set the character's rotation mode to ViewDirection and update the direction the character should face by setting ControlRotation.
You can also call the API on the GMS_CharacterMovementSysytem component that starts with SetRotation to directly control the rotation of the character.
Switch overlay mode

Response to events
When you call different functions on the movement system component, corresponding events will be triggered, allowing you to respond to the results of the operation.

For example: after you go back toMovementSet.Default
fromMovementSet.ADS
(which sets the character to walk), you want the character to go back to jog state. Then you can do the following:

Other available APIs
In GMS, all commonly used APIs are categorised starting with GMS, you can typing "GMS" in the ContextAction list in the blueprint to see all the available APIs.