# 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

### 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)
```

### 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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overdare.com/development/api-reference/classes/actionsequence.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
