GS_MotionTrack

Abstract base class for all animation tracks — fields, lifecycle, and virtual methods for domain extension.

GS_MotionTrack is the abstract base class for all animation tracks in the GS_Motion system. Each track animates one aspect of an entity over a time window within a motion. Domain gems extend this with concrete track types — GS_UI provides 8 LyShine tracks, GS_Juice provides 2 feedback tracks.

For usage guides and setup examples, see The Basics: GS_Core.


Fields

FieldTypeDescription
m_idAZ::UuidUnique track identifier (auto-generated).
m_identifierAZStd::stringProxy label — if set, the track appears in the proxy list for entity override targeting.
curveTypeCurveTypeEasing curve applied to track progress (from the Curves utility library).
startTimefloatTime offset before the track begins playing (seconds).
durationfloatTrack playback duration (seconds).
startVarianceMinfloatMinimum random variance added to start time.
startVarianceMaxfloatMaximum random variance added to start time.

Lifecycle

Each track goes through a fixed lifecycle managed by the parent GS_Motion:

PhaseMethodDescription
InitializeInit(AZ::EntityId owner)Stores the owner entity. Called once when the motion is initialized.
StartStart()Called when the track’s time window begins.
UpdateUpdate(float easedProgress)Called each frame with eased progress (0 → 1). Override this in concrete tracks.
EndEnd()Called when the track’s time window completes.
UnloadUnload()Cleanup. Called when the motion is unloaded.

Virtual Methods

These methods must be overridden in concrete track implementations:

MethodReturnsDescription
Update(float easedProgress)voidApply the animation at the given eased progress value (0 → 1).
GetTypeName()AZStd::stringReturn the track’s display name for proxy labels in the editor.

Extension Guide

To create a new domain of animation tracks:

  1. Create a domain base track: class MyTrack : public GS_Core::GS_MotionTrack — this serves as the common base for all tracks in your domain.
  2. Create concrete tracks extending the domain base — each overrides Update(float easedProgress) to animate a specific property.
  3. Reflect the track class using O3DE’s SerializeContext and EditContext. The system discovers the new type automatically.

Critical: Track vectors must use raw pointers (vector<MyTrack*>). Never use unique_ptr — O3DE SerializeContext requires raw pointers for polymorphic enumeration in the asset editor.


See Also


Get GS_Core

GS_Core — Explore this gem on the product page and add it to your project.