> For the complete documentation index, see [llms.txt](https://docs.overdare.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overdare.com/development/api-reference/classes/actionsequence.md).

# ActionSequence

ActionSequence : `Instance`

## Overview

An ActionSequence is an instance that allows you to compose animations, effects, camera work, and other elements for a single action in an integrated timeline. It provides a visual, timeline-based editing environment to configure commonly used in-game sequences and script execution timing.

ActionSequences are defined as **static data objects** and cannot be created directly at runtime using Instance.new or Clone.

When execution is requested via the Play method on the **ActionRunner** under a Humanoid, the original ActionSequence instance is **cloned** into Humanoid.ActionRunner, and the action is executed based on the cloned instance.

Due to this structure, when c**onnecting events within ActionSequence scripts**, you must reference the runtime duplicated instance rather than the original instance. Therefore, instead of using absolute paths, you should **reference based on script.Parent**.

Events can be connected in both server and client environments. However, **server-side Scripts are recommended to be placed directly under the ActionSequence**, as they may not function properly when placed deeper in the hierarchy.

**If events are connected in a LocalScript under the ActionSequence, the logic will be executed on all clients**. Therefore, you should filter based on the executor (self) of the ActionSequence when necessary.

## Properties

## Methods

### GetAllTrackInfos

Returns all track information in the ActionSequence.

Track information can only be retrieved while the ActionSequence is running.

When an ActionSequence is played, a runtime instance is created under Humanoid.ActionRunner. Since completed or stopped ActionSequences may be removed, the returned information should only be used while the ActionSequence remains valid.

Excessive calls to this method may impact performance. Call it only when necessary.

#### Parameters

#### Return

| `Value` | A table containing all track information in the ActionSequence. |
| ------- | --------------------------------------------------------------- |

#### Code Samples

```lua
local ActionSequence = script.Parent
local TrackInfos = ActionSequence:GetAllTrackInfos() -- Retrieve all track information

for i = 1, #TrackInfos do
    local trackInfo = trackInfos[i]

    print(trackInfo.TrackName)
    print(trackInfo.TrackType)
    print(trackInfo.IsEnable)
    print(trackInfo.TrackData)
end
```

### GetMarkerReachedSignal

Returns an event that fires when a marker with the specified name, defined in the ActionSequence’s event track, is reached.

#### Parameters

| `string` MarkerName | The name of the marker. |
| ------------------- | ----------------------- |

#### Return

| `ScriptSignal` | The marker reached event. |
| -------------- | ------------------------- |

#### Code Samples

```lua
local ActionSequence = script.Parent

-- self : The character model that executed the ActionSequence is passed.
ActionSequence:GetMarkerReachedSignal("EventName"):Connect(function(self)
    -- ...
end)
```

### GetTrackInfo

Returns the track information that matches the specified track name and track type.

Track information can only be retrieved while the ActionSequence is running.

When an ActionSequence is played, a runtime instance is created under Humanoid.ActionRunner. Since completed or stopped ActionSequences may be removed, the returned information should only be used while the ActionSequence remains valid.

Excessive calls to this method may impact performance. Call it only when necessary.

#### Parameters

| `string` TrackName                       | The name of the track to retrieve information from. |
| ---------------------------------------- | --------------------------------------------------- |
| `Enum.ActionSequenceTrackType` TrackType | The type of the track to retrieve information from. |

#### Return

| `Value` | A table containing the track information of the ActionSequence. |
| ------- | --------------------------------------------------------------- |

#### Code Samples

```lua
local ActionSequence = script.Parent
local TrackName = "SomeColTrackName_1"
local TackType = Enum.ActionSequenceTrackType.CollisionTrack
local TrackInfo = ActionSequence:GetTrackInfo(TrackName, TrackType) -- Retrieve specific track information

if TrackInfo ~= nil then
    print(TrackInfo.TrackName)
    print(TrackInfo.TrackType)
    print(TrackInfo.IsEnable)
    print(TrackInfo.TrackData)
end
```

### Hit

Returns an event that fires when a marker with the specified name, defined in the ActionSequence’s collision track, is reached.

#### Parameters

| `string` InCollisionEventName | The name of the collision event. |
| ----------------------------- | -------------------------------- |

#### Return

| `ScriptSignal` | The collision event. |
| -------------- | -------------------- |

#### Code Samples

```lua
local ActionSequence = script.Parent

-- self : The character model that executed the ActionSequence is passed.
-- other : The target object detected by the collision check (character model or Part) is passed.
ActionSequence:Hit("CollisionEventName"):Connect(function(self, other)
    -- ...
end)
```

### TriggerEnded

Returns an event that fires when a trigger with the given name, defined in the ActionSequence’s trigger track, ends.

#### Parameters

| `string` TriggerName | The name of the trigger. |
| -------------------- | ------------------------ |

#### Return

| `ScriptSignal` | The trigger ended event. |
| -------------- | ------------------------ |

#### Code Samples

```lua
local ActionSequence = script.Parent

-- self : The character model that executed the ActionSequence is passed.
ActionSequence:TriggerEnded("TriggerName"):Connect(function(self)
    -- ...
end)
```

### TriggerStarted

Returns an event that fires when a trigger with the given name, defined in the ActionSequence’s trigger track, starts.

#### Parameters

| `string` TriggerName | The name of the trigger. |
| -------------------- | ------------------------ |

#### Return

| `ScriptSignal` | The trigger started event. |
| -------------- | -------------------------- |

#### Code Samples

```lua
local ActionSequence = script.Parent

-- self : The character model that executed the ActionSequence is passed.
ActionSequence:TriggerStarted("TriggerName"):Connect(function(self)
    -- ...
end)
```

## Events

## See also

{% content-ref url="/pages/P9IC3JUvm3Er0Yx21SvQ" %}
[ActionSequence](/manual/studio-manual/game-development/actionsequence.md)
{% endcontent-ref %}

{% content-ref url="/pages/gnogIOuaAA9t0jRSmVYE" %}
[Running ActionSequences](/manual/studio-manual/game-development/actionsequence/running-actionsequences.md)
{% endcontent-ref %}
