Grounders
Categories:
Grounders run each physics tick to determine whether the unit is in contact with the ground, what the slope looks like, and whether the surface is walkable. They write their findings to the MoverContext and switch movement modes when the ground state changes.
For usage guides and setup examples, see The Basics: GS_Unit.

Contents
Class Hierarchy
GS_GrounderComponent (base — mode-aware activation, tick management)
└── GS_PhysicsRayGrounderComponent (grounding mode: "Free")
GS_GrounderComponent (Base)
Tick: AzPhysics::SystemEvents::OnPostSimulateEvent (after the physics step).
Mode-Aware Activation
Listens to MoverContextNotificationBus::GroundingModeChanged. Compares the broadcast mode name against its own m_groundModeName. Calls ToggleGrounder(true/false) accordingly. The physics post-simulate handler is only registered when the grounder is active.
Per-Tick Processing
Each tick:
CheckCanOperate()— validates required pointers and stateHandleGrounding()— performs ground detection and updates MoverContext (no-op in base)
Key Fields
| Field | Description |
|---|---|
m_groundModeName | Grounding mode string this grounder activates for |
delta | Cached frame delta time |
Concrete Grounders
| Component | Grounding Mode | Description |
|---|---|---|
| GS_PhysicsRayGrounderComponent | "Free" | Raycast-based grounder with coyote time, slope detection, and manual gravity |
API Reference
Virtual Methods
Override these when extending any grounder:
| Method | Parameters | Returns | Description |
|---|---|---|---|
ToggleGrounder | bool on | void | Called when the grounding mode activates or deactivates. |
HandleGrounding | — | void | Called each tick when the grounder is active. Override to implement ground detection logic. |
GroundingStateChange | AZ::u32 newState | void | Called when ground contact state changes. Override to react to grounding transitions. |
CheckCanOperate | — | bool | Returns true if the grounder has everything it needs to run this tick. |
Consumed Buses
| Bus | Event | Description |
|---|---|---|
MoverContextNotificationBus | GroundingModeChanged(modeName) | Activates or deactivates this grounder based on mode name match. |
Produced Calls
| Bus | Method | Description |
|---|---|---|
MoverContextRequestBus | SetGroundNormal(normal) | Updates the ground normal used by the MoverContext for input projection. |
MoverContextRequestBus | SetContextState("grounding", value) | Sets grounding state: 0 = Falling, 1 = Grounded, 2 = Sliding. |
MoverContextRequestBus | ChangeMovementMode(modeName) | Switches to "Slide" when slope exceeds maxWalkAngle, or back to "Free" on recovery. |
Extension Guide
Use the Grounder ClassWizard template to generate a new grounder with boilerplate already in place — see GS_Unit Templates. The template offers two base class options: Physics Ray Grounder (default, includes raycast, coyote time, and gravity) or Base Grounder for fully custom detection.
Extend GS_GrounderComponent to implement custom ground detection.
#pragma once
#include <Source/Unit/Grounder/GS_GrounderComponent.h>
namespace MyProject
{
class MyGrounder : public GS_Unit::GS_GrounderComponent
{
public:
AZ_COMPONENT_DECL(MyGrounder);
static void Reflect(AZ::ReflectContext* context);
protected:
void Activate() override;
void HandleGrounding() override;
void GroundingStateChange(AZ::u32 newState) override;
private:
// Set in Activate():
// m_groundModeName = "Free";
};
}
In HandleGrounding(), run your detection and write results to the MoverContext:
void MyGrounder::HandleGrounding()
{
AZ::Vector3 groundNormal = AZ::Vector3::CreateAxisZ();
bool isGrounded = false;
// ... custom detection logic ...
GS_Unit::MoverContextRequestBus::Event(
GetEntityId(),
&GS_Unit::MoverContextRequestBus::Events::SetGroundNormal,
groundNormal
);
AZ::u32 state = isGrounded ? 1 : 0;
GS_Unit::MoverContextRequestBus::Event(
GetEntityId(),
&GS_Unit::MoverContextRequestBus::Events::SetContextState,
"grounding", state
);
}
See Also
- GS_PhysicsRayGrounderComponent — The standard raycast grounder
- Mover Context — Receives ground state and normal from grounders
- Movers — Consume ground state to drive physics
- Movement — Movement system overview
Get GS_Unit
GS_Unit — Explore this gem on the product page and add it to your project.