Slide Mover
Categories:
GS_3DSlideMoverComponent handles slope-sliding locomotion. It activates automatically when the grounder detects a slope angle exceeding maxWalkAngle, and deactivates when the slope eases or the unit slows enough to recover.
Mode names: "Slide" (both movement and rotation)
For usage guides and setup examples, see The Basics: GS_Unit.

Contents
How It Works
HandleMovement()
Called each post-physics tick while movement mode is "Slide":
- Reads
slopeDirfromMoverContextRequestBus::GetSlopeDirection. - Computes
destinationVelocity = slopeDir * baseSlideSpeed. - If
EnableInputSlideResistanceis true, readsgroundedMoveInputand applies an opposing influence:This allows the player to push slightly against or across the slide direction.destinationVelocity += groundedMoveInput * InputResistanceInfluence - Fetches
rigidBody->GetLinearVelocity()as the current velocity. - Calls
GS_Core::Springs::AccelerationSpringDamper(position, velocity, cachedAcceleration, destinationVelocity, moveHalflife, delta). - Applies the result:
rigidBody->SetLinearVelocity(velocity). - Calls
FinishSliding()to check whether the slide should end.
HandleRotation()
- Reads
slopeDirfrom the MoverContext. - Computes target yaw from slope direction using
atan2f— unit faces down the slope. - Calls
GS_Core::Springs::QuaternionSpringDamper(currentRotation, cachedAngularVelocity, targetRotation, rotateHalflife, delta). - Applies
cachedAngularVelocity.ZtorigidBody->SetAngularVelocity().
Finish Sliding
FinishSliding() is called every movement tick. It returns true and triggers recovery when both conditions are met:
- The current slope angle is below
minSlideAngle - The unit’s current speed is below
minSpeedToStop
On recovery:
MoverContextRequestBus::ChangeMovementMode(recoveryMoveMode);
MoverContextRequestBus::ChangeRotationMode(recoveryRotateMode);
Both modes default to "Free", returning the unit to standard locomotion.
Editor-Exposed Settings
| Field | Default | Description |
|---|---|---|
moveHalflife | 0.1 | Spring halflife for slide velocity. |
rotateHalflife | 0.15 | Spring halflife for rotation toward slope direction. |
baseSlideSpeed | 8.0 | Target speed along the slope direction (m/s). |
EnableInputSlideResistance | true | Whether player input can partially resist or redirect the slide. |
InputResistanceInfluence | 2.0 | Scalar applied to groundedMoveInput when computing resistance. Higher = more player control. |
minSlideAngle | 20° | Slope angle below which the unit may recover (if also slow enough). |
minSpeedToStop | 1.5 | Speed threshold below which the unit may recover (if also on shallow slope). |
recoveryMoveMode | "Free" | Movement mode to switch to on recovery. |
recoveryRotateMode | "Free" | Rotation mode to switch to on recovery. |
Extension Guide
Extend GS_3DSlideMoverComponent to override slide behavior while keeping the base spring physics and recovery logic.
#pragma once
#include <Source/Unit/Mover/GS_3DSlideMoverComponent.h>
namespace MyProject
{
class MySlide : public GS_Unit::GS_3DSlideMoverComponent
{
public:
AZ_COMPONENT_DECL(MySlide);
static void Reflect(AZ::ReflectContext* context);
protected:
void HandleMovement() override;
};
}
void MySlide::HandleMovement()
{
// Call base for standard slope physics
GS_3DSlideMoverComponent::HandleMovement();
// Add custom post-processing (e.g. audio trigger, particle effect on slide)
}
See Also
- Movers — Mover base class and class hierarchy
- GS_3DFreeMoverComponent — Standard free-locomotion mover
- Mover Context — Provides
slopeDir,groundedMoveInput, and mode switching - Grounders — Detect slope angle and trigger the switch to Slide mode
- Springs Utility —
AccelerationSpringDamperandQuaternionSpringDamperused internally
Get GS_Unit
GS_Unit — Explore this gem on the product page and add it to your project.