# Creating ActionSequences

## Overview

This guide explains the full creation process step by step, from creating an ActionSequence and configuring its tracks to completing the presentation and verifying the result through execution.

In this document, you will create an ActionSequence directly while learning the basic workflow and how to use it.

## 3-Hit Combo Action

### Learning Outcomes

<figure><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F44pXPnkt3Mjl3dIt9o2H%2FAseqGif2.gif?alt=media&#x26;token=29921cf2-f99a-4f4c-bd17-99319e05f3af" alt=""><figcaption></figcaption></figure>

By completing this tutorial, you will be able to create the following setup:

* A chained attack animation sequence consisting of 3 stages (1st, 2nd, and 3rd hits)
* Collision detection and script-based damage processing timed to each hit
* Hit effects that play in sync with the impact timing
* Camera shake applied during the 3rd hit phase
* Player input disabled while the 3rd hit is in progress
* Execution of the ActionSequence via button input

### Asset List

<table><thead><tr><th width="140.9998779296875">Asset Type</th><th width="229">Asset ID</th><th>Description</th></tr></thead><tbody><tr><td>Animation</td><td>ovdrassetid://18169100</td><td>1st Hit</td></tr><tr><td>Animation</td><td>ovdrassetid://18171100</td><td>2nd Hit</td></tr><tr><td>Animation</td><td>ovdrassetid://18173300</td><td>3rd Hit</td></tr></tbody></table>

### Tutorial

<table data-full-width="true"><thead><tr><th width="233.33331298828125">Step</th><th width="590">Task</th><th>Notes</th></tr></thead><tbody><tr><td><ol><li>Create ActionSequence</li></ol></td><td><ul><li>Add an ActionSequence instance under the ActionSequenceService.<img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FAMf02JKiLeZNIEGi2Wgg%2FASeq-Tuto-Image-1.png?alt=media&#x26;token=fdbcca65-4dd5-4a53-a188-51afebf6a2d9" alt=""></li><li>Rename it to 3-HitCombo.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FiT6sHbz3QxxwX9RhJATn%2FASeq-Tuto-Image-2.png?alt=media&#x26;token=80ac5ebe-8bfa-4e0d-9237-938077875670" alt=""></li></ul></td><td><ul><li>The ActionSequence name must be unique.</li></ul></td></tr><tr><td><ol start="2"><li>Open ActionSequence Editor</li></ol></td><td><ul><li>Hover the mouse over the ActionSequence instance, then click the Open button that appears.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FhH7VvY6khTEi35wqtGqu%2FASeq-Tuto-Image-3.png?alt=media&#x26;token=32b681f2-5cc4-4501-836e-d8ba4af28259" alt=""></li></ul></td><td><ul><li>Changes made during play mode are not reflected immediately and are applied when you run it again.</li></ul></td></tr><tr><td><ol start="3"><li>Animation Track <br>(1st Hit)</li></ol></td><td><ul><li>Click the Add Track button to add an Animation Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FHZW8mzPHS2Kj8Ca7LgaS%2Fimage.png?alt=media&#x26;token=5f74654e-44bc-42b7-8c02-4cebd7b56a4d" alt=""></li><li>Select the track, then specify the animation ID for the 1st hit in Ovdr Asset Id in the Track Property panel.<br>(ovdrassetid://18169100)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FpRVW0uR5vUxwCQJeS5ts%2Fimage.png?alt=media&#x26;token=5d6a2d40-2300-4076-b4bb-a7cdfc2f7686" alt=""></li><li>Set Blend in / Out Time to 0.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FnmDa7hERQZYtGTz6rPAm%2Fimage.png?alt=media&#x26;token=b2c21279-c3d9-409c-ba48-53bf03b1969b" alt=""></li></ul></td><td></td></tr><tr><td><ol start="4"><li>Preview</li></ol></td><td><ul><li>Press the Play button or Spacebar to play the timeline and check the animation.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FUZNSsHmo0wMFmhocaVtA%2Fimage.png?alt=media&#x26;token=337132b9-c194-416a-aaed-ab68b810de4a" alt=""></li></ul></td><td></td></tr><tr><td><ol start="5"><li>Animation Track <br>(2nd Hit)</li></ol></td><td><ul><li>Add a new Animation Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F0gF4R95BHSAUkznwYDAC%2Fimage.png?alt=media&#x26;token=83e3837d-26ac-4c13-bc25-d8000975765e" alt=""></li><li>Select the track and specify the animation ID for the 2nd hit in Ovdr Asset Id.<br>(ovdrassetid://18171100)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FesZ7yGRYGug3KyNxoxK6%2Fimage.png?alt=media&#x26;token=e684d1db-23f5-4dac-a36e-b6b41f94d879" alt=""></li><li>Set Blend in / Out Time to 0.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FnmDa7hERQZYtGTz6rPAm%2Fimage.png?alt=media&#x26;token=b2c21279-c3d9-409c-ba48-53bf03b1969b" alt=""></li><li>Adjust the section position so that it comes after the 1st hit.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F85N2Oi8foY0uL0lC3bVE%2Fimage.png?alt=media&#x26;token=79162fb7-8876-4456-8e8e-22600af76b4f" alt=""></li></ul></td><td></td></tr><tr><td><ol start="6"><li>Animation Track <br>(3rd Hit)</li></ol></td><td><ul><li>Add a new Animation Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FStnxrPZI5fu7pG6Qs1f5%2Fimage.png?alt=media&#x26;token=bbeb7e6a-8dd0-4792-bae7-bfef60075842" alt=""></li><li>Select the track and specify the animation ID for the 2nd hit in Ovdr Asset Id.<br>(ovdrassetid://18173300)</li><li>Set Blend in / Out Time to 0.</li><li>Adjust the section position so that it comes after the 2nd hit.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F3GxZlRWqxZNQGCqeXlvz%2Fimage.png?alt=media&#x26;token=9fba1240-7db1-482f-a8a1-dcc0ad2e671d" alt=""></li><li>Play it back and check the animation.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FJdWPeQCNWv3p2AcRe4Eq%2Fimage.png?alt=media&#x26;token=53c94080-61e4-413f-99ba-9bc8b197bd1a" alt=""></li></ul></td><td></td></tr><tr><td><ol start="7"><li>Animation Blend</li></ol></td><td><ul><li>To prevent the animation from breaking during transitions, set the Blend In / Out Time of each animation to 0.25.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F8XCJ2Uk5zjQk2PAStwQR%2Fimage.png?alt=media&#x26;token=0f7647b3-2522-4717-b554-0f84be83173e" alt=""></li><li>Arrange them so that the start and end of each animation overlap.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FwGq9AuUHtApmFxbc7O3H%2FASeq-Tuto-Image-5.png?alt=media&#x26;token=971515d1-e81f-45cb-a98a-efeb3ac3da8d" alt=""></li><li>Play the timeline and check the animation.</li><li>To prevent the original length of the animation from not being fully represented by 0.25 seconds due to the blend time, extend the section length beyond the original length.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FvWM8hFk246Mupjt1oEy1%2FASeq-Tuto-Image-6.png?alt=media&#x26;token=f5158f34-04b2-4bf8-b76c-604a37c56605" alt=""></li><li>Play the timeline while checking whether the animation transition looks natural, and adjust the section lengths.</li></ul></td><td><ul><li>In the blend section, the previous animation and the next animation are both applied at the same time, and the weight values change so that the transition occurs smoothly.<br>In this section, <strong>the original animation is not played back 100% exactly as-is</strong>; instead, the <strong>result blended</strong> with the other animation is applied.</li></ul></td></tr><tr><td><ol start="8"><li>Save</li></ol></td><td><ul><li>Press Save or Ctrl + S to save your work.<br>(When the save is complete, the message Sequence Changes Saved is displayed.)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FOKkQkdwLP24R6ttcDLuR%2Fimage.png?alt=media&#x26;token=67b45db6-b2ab-4e55-8329-ec2f972b6a35" alt=""></li></ul></td><td><ul><li>Save frequently so that your work is not lost.</li><li>If there are changes, an asterisk (*) is displayed next to the ActionSequence name and the Save button.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F1LZSrbVe4PukwrvlY8sq%2Fimage.png?alt=media&#x26;token=a1ec7254-763e-42d6-ac97-2ef916d5022b" alt=""></li></ul></td></tr><tr><td><ol start="9"><li>Apply Upper Body Animation</li></ol></td><td><ul><li>Change the Slot Type of the 1st/2nd hit animation tracks to Upper Body.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F6MNzGzxWY0CHCbftxPcu%2Fimage.png?alt=media&#x26;token=b862b282-ccc1-410c-8d16-ef688ce0a339" alt=""></li></ul></td><td><ul><li>The body region to which the animation is applied is determined by the Slot Type.</li></ul></td></tr><tr><td><ol start="10"><li>Control Viewport Camera</li></ol></td><td><ul><li>After clicking Viewport, use the WASD keys to move the camera and right-click the mouse to adjust the camera position so the animation is clearly visible from the side of the character being attacked.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FxQ6Aesy9dkKkXenIAD0v%2Fimage.png?alt=media&#x26;token=e59ac05c-1a8d-49b1-b75f-d4f413383889" alt=""></li></ul></td><td></td></tr><tr><td><ol start="11"><li>Collision Track</li></ol></td><td><ul><li>Add a Collision Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F7oX2Af3dUMl24k4M0KWM%2Fimage.png?alt=media&#x26;token=ae2adf78-856b-4164-8a13-10c48be2893f" alt=""></li><li>Expand the collision track in the track list so that the Value field of the Collision Track is visible.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FSVKLDeWCVMaffjoKboud%2Fimage.png?alt=media&#x26;token=9685178b-0b8d-4fb5-bfa4-b01a605d6036" alt=""></li><li>In the Value area of the timeline, add 3 markers at appropriate positions according to the animation track count by clicking the mouse wheel button or using Ctrl + left-click.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FhlIf8XNZqfBo4YcoFWzn%2Fimage.png?alt=media&#x26;token=0390fea5-8334-48a2-925f-704d9a61d719" alt=""></li><li>Move the scrubber and adjust the positions of the 3 keyframes to match the animation timing.<br>(Do not worry about the collision position yet!)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FwXwLGzHqsmXolXncfE6j%2Fimage.png?alt=media&#x26;token=3d55590e-1980-4cc1-b104-837b13208682" alt=""></li></ul></td><td><ul><li>The horizontal axis of the timeline can be zoomed in/out with Ctrl + mouse wheel up/down.</li></ul></td></tr><tr><td><ol start="12"><li>Collision Detailed Settings</li></ol></td><td><ul><li>Select each keyframe and change the Collider Type to Box.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FQzCwSgHNBTc4kKS2dhwF%2Fimage.png?alt=media&#x26;token=fdc516de-3fef-4648-a582-74e7ff47e7ca" alt=""></li><li>Expand all Collider fields so they are visible, then change the Box Extent of each keyframe to (100, 150, 100).<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FbCuK2tXvZK40VpGE9vBJ%2Fimage.png?alt=media&#x26;token=c4099982-5dbd-4e5a-ac73-0b1c73248868" alt=""></li><li>Expand all Attachment Offset fields so they are visible, then change the Relative Location of each keyframe to (0, 0, -100).<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FX5GTrg8QMCsEiYJc5RpL%2Fimage.png?alt=media&#x26;token=05fcd0bd-9d7c-4dc7-8ecb-71b469c0fe8e" alt=""></li><li>Change the Collision Event Name of each keyframe to Hit1, Hit2, Hit3.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F23rveTitwDXCf6awl9Ax%2Fimage.png?alt=media&#x26;token=645d36cf-d7eb-4584-9eaa-76e970823786" alt=""></li><li>Move the scrubber to check whether the collision position looks natural and adjust it.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FOxGpZuliuSSYX3uQvfBd%2Fimage.png?alt=media&#x26;token=a82e8135-f1fe-4e1c-a2d2-d15f55a80e9a" alt=""></li><li>Save your work.</li></ul></td><td><ul><li>The Collision Event Name is used for script event connections.</li></ul></td></tr><tr><td><ol start="13"><li>Run ActionSequence</li></ol></td><td><ul><li>Add a Script under the ActionSequence and rename it to CollisionTrackScript.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FRwpKBsJYBLxYAWQzz0g4%2Fimage.png?alt=media&#x26;token=3c49beaf-ffb0-49e4-83b0-ec9bb04c237e" alt=""></li><li><p>Open the script and write the following to handle collisions:</p><pre class="language-lua"><code class="lang-lua">local Sequence = script.Parent

for i = 1, 3 do
Sequence:Hit("Hit" .. i):Connect(function(self, other)
if self == other then
return
end

```
    print("Hit" .. i, self, other)

    local caster = self:FindFirstChild("Humanoid")
    local target = other:FindFirstChild("Humanoid")

    if caster and target then
	      target.Health -= 40
	      print("Health : ", target.Health, " / ", target.MaxHealth)
    end
end)
```

end </code></pre></li><li><p>Under StarterPlayer.StarterCharacterScripts, add a LocalScript and write the following content.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FU333PDV1ZvcOMZZbVuIl%2Fimage.png?alt=media&#x26;token=2e4ff72b-a5ef-4009-8fe3-196ae713fad6" alt=""></p><pre class="language-lua"><code class="lang-lua">local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local ScreenGui = PlayerGui:WaitForChild("ScreenGui")

local PlayButton1 = Instance.new("TextButton")
PlayButton1.Position = UDim2.new(0.5, 0, 0.1, 0)
PlayButton1.Text = "Play 3-Hit Combo"
PlayButton1.TextScaled = true
PlayButton1.Parent = ScreenGui

PlayButton1.Activated:Connect(function()
local character = LocalPlayer.Character
local humanoid = character:WaitForChild("Humanoid")
local actionRunner = humanoid:GetActionRunner()

```
local key = "3-HitCombo"
local transitionTime = 0
actionRunner:Play(key, transitionTime)

print("Play : " .. key)	
```

end) </code></pre></li></ul></td><td><ul><li>Executing ActionSequence and connecting events can be done in both server-side Scripts and LocalScripts.</li></ul></td></tr><tr><td><ol start="14"><li>Verify Collision Detection</li></ol></td><td><ul><li>Set the number of players to 2 and run a play test.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FFrUz4byfyMHMOanybbes%2Fimage.png?alt=media&#x26;token=5a5c14fe-7ec7-41bd-85c9-680ea7620cbc" alt=""></li><li>Move Player1’s character in front of Player2’s character, then press the Play 3-Hit Combo button to execute the ActionSequence and verify that the character dies when all attacks hit successfully.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FOlHdNqI9lkIQk5vfbyZF%2Fimage.png?alt=media&#x26;token=ef8abbc7-39b4-4a07-a7f5-9bc79c4ffa1b" alt=""></li><li>End the play test.</li></ul></td><td><ul><li>If you enable <strong>Show Collision</strong> in the <strong>View</strong> <strong>tab</strong> of the Studio toolbar, the collision areas will be visually displayed in the viewport when collision track detection occurs during play.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F3aYc19yjFTlNzAwJVcdV%2Fimage.png?alt=media&#x26;token=2a6546b3-3f25-4f65-ba8f-b33117e14dee" alt=""></li></ul></td></tr><tr><td><ol start="15"><li>Control Track</li></ol></td><td><ul><li>Add a Part under the ActionSequence, then add a VFXPreset under the Part.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2Ft8YAmiWnhfDQhywQI53z%2Fimage.png?alt=media&#x26;token=ec53c119-dc11-4165-8765-4f4e93e47672" alt=""></li><li>Rename the Part to HitFXPart, and the VFXPreset to HitFX1.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FiMYqu74EMVVX6P3K8HzS%2Fimage.png?alt=media&#x26;token=81becd2c-55ad-4cc1-9d3d-5b1f85dab96b" alt=""></li><li>Set CanCollide of HitFXPart to false, and Transparency to 1.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F4BU38xvbUBMNguxdwanI%2Fimage.png?alt=media&#x26;token=e50233a6-516d-44ed-aec7-2b2bcefe0f05" alt=""></li><li>Change the appearance of HitFX1 to Simple Hit, and set Enabled to false.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FYPgkMPKh59cbEtRlrEHF%2Fimage.png?alt=media&#x26;token=41172629-1006-43fd-ba95-42383746b8d9" alt=""></li><li>Add a Control Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FaYbhQKNYYN4AEuU4I7rP%2Fimage.png?alt=media&#x26;token=c7cf68b3-09d8-4977-995f-bb8d16e9debb" alt=""></li><li>Select the track, then click the reference link button in the Ref Object field and select HitFXPart in the Level Browser.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2Fb0M7qYmYLV12KMuuiwBy%2Fimage.png?alt=media&#x26;token=95547c82-779c-4a64-ae4f-54a724ff4477" alt=""></li></ul></td><td><ul><li>To avoid confusion when structuring objects under ActionSequence, it is <strong>recommended not to use identical names for objects</strong>.</li></ul></td></tr><tr><td><ol start="16"><li>Effect Settings <br>(1st Hit)</li></ol></td><td><ul><li>Expand all Control Tracks so that the Value field of HitFX1 under HitFXPart is visible.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FmMA4HgrRY7W0fNn4SBcx%2Fimage.png?alt=media&#x26;token=146c4da1-ebec-400d-b9bb-65e10b787ac9" alt=""></li><li>In the Value area of the timeline, click the mouse wheel or use Ctrl + left-click to add a keyframe.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F1Od1DKKkaspwomeeLHqd%2Fimage.png?alt=media&#x26;token=99d8ee6c-146f-4f13-b399-60e2690b747e" alt=""></li><li>Select the keyframe and set the Time field to 0.<br>(If the Value field is not false, set it to false.)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FwEM6qx31sSyitnaLaMDB%2Fimage.png?alt=media&#x26;token=d2280d2a-3441-4863-90c2-3c45d30a2702" alt=""></li><li>Insert a keyframe at the timing of the 1st hit collision, and set the Value field to true.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2Fl9bx9mkOQqmoBh0Iea0O%2Fimage.png?alt=media&#x26;token=94ee414c-15f5-4e84-98e5-fd07f30da2f4" alt=""></li></ul></td><td></td></tr><tr><td><ol start="17"><li>Control Track Fine Adjustment</li></ol></td><td><ul><li>Click the Control Track, expand all Attachment Offset fields, and change the Relative Location field to (100, 100, 0).<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FDEjiiX28JhAOXKMEmmJo%2Fimage.png?alt=media&#x26;token=e98c8f62-1fd9-45c7-8589-7d6799439fde" alt=""></li><li>Move the scrubber to check whether the effect position looks natural and adjust it.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FV0hzr3jcMsxyt4C5LtLk%2Fimage.png?alt=media&#x26;token=5ed3ec1e-05cf-4acd-a360-5396841a5ea7" alt=""></li></ul></td><td></td></tr><tr><td><ol start="18"><li>Effect Settings <br>(2nd Hit)</li></ol></td><td><ul><li>To reuse the same effect as the 1st hit, insert a keyframe right before the 2nd hit collision timing and set the Value field to false.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FPstmqoHgr21n13dgmp6R%2Fimage.png?alt=media&#x26;token=899d2ef0-7005-4520-a22f-2ed8e92527e0" alt=""></li><li>Then, insert a keyframe at the collision timing and set the Value field to true.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FK26iLAPIf6JW2e8QRVUR%2Fimage.png?alt=media&#x26;token=25b0d14a-4d4b-4ef2-91b0-a9c8c9a860d1" alt=""></li><li>Save your work.</li></ul></td><td></td></tr><tr><td><ol start="19"><li>Effect Settings <br>(3rd Hit)</li></ol></td><td><ul><li>To use a new effect, add a VFXPreset under the Part.</li><li>Rename the VFXPreset to HitFX2.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FGJo5dGFTbH7AL3LIX4x8%2Fimage.png?alt=media&#x26;token=11128e6f-676f-4181-b05a-3945652aba2a" alt=""></li><li>Change the appearance of HitFX2 to Explosion, and set Enabled to false.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F9qXfcNtEmQOk3XmvHBgV%2Fimage.png?alt=media&#x26;token=e916e1e7-1fcf-41b9-8add-dbe103f6f96a" alt=""></li><li>Expand all Control Tracks so that the Value field of HitFX2 is visible in the track list.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FA6O4iQdju61lAJQyQYdr%2Fimage.png?alt=media&#x26;token=486fac5b-e90f-4c84-91cc-e023698a6964" alt=""></li><li>In the Value area of the timeline, click the mouse wheel or use Ctrl + left-click to add a keyframe.</li><li>Select the keyframe and set the Time field to 0.<br>(If the Value field is not false, set it to false.)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FwEM6qx31sSyitnaLaMDB%2Fimage.png?alt=media&#x26;token=d2280d2a-3441-4863-90c2-3c45d30a2702" alt=""></li><li>Insert a keyframe at the 3rd hit collision timing and set the Value field to true.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F2HavJvnl9fnEbWNbgIjM%2Fimage.png?alt=media&#x26;token=3ff896b2-d713-465d-94e7-a5ca0fd506b1" alt=""></li><li>To ensure the 3rd hit effect appears on the ground, add a keyframe to the Y value of OriginPosition in the Control Track and set the Value field to -100.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FQsKdpXzAFpQQlHjm9SVF%2Fimage.png?alt=media&#x26;token=bdf019ff-8908-4634-89cd-2ff9d922fbc2" alt=""></li><li>Adjust the keyframe position so that the position changes before the effect is played, placing it before the 3rd hit effect timing.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FiHInmiFSsOyCignAQpmZ%2Fimage.png?alt=media&#x26;token=6be755d0-9755-4910-8654-1025dfec94f6" alt=""></li><li>Play the timeline and check the effect positions for the 1st to 3rd hits.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FRmeojzPUlH2GCtoiDakz%2Fimage.png?alt=media&#x26;token=506f6f3c-d340-463f-9518-1e88f651dd1f" alt=""></li><li>To prevent the 1st and 2nd hit effects from being affected, add a keyframe for the Y value of OriginPosition at the start of the timeline, set the Time field to 0, and the Value field to 0.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FRcRfVLxqPq9VgCmFD8E7%2Fimage.png?alt=media&#x26;token=e10bd3ef-e501-4c16-a39b-77db0dcf2c64" alt=""></li><li>To prevent the position from gradually changing between the 1st and 3rd hits, add a keyframe between the 2nd and 3rd hits and set the Value field to 0.<br>(This ensures that after the 2nd hit, while the effect is not visible, the position changes, and the updated position is applied only at the 3rd hit.)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FytDVHewUz1jCTYs2fuNH%2Fimage.png?alt=media&#x26;token=f40aa65c-a358-433c-b41a-fe33a7841638" alt=""></li><li>Move the scrubber to check whether the effect position looks natural and adjust it.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FXSptzJYtzU1rYbvn2Tl4%2Fimage.png?alt=media&#x26;token=16e9185c-78a1-4853-b8bf-281e344916b1" alt=""></li></ul></td><td></td></tr><tr><td><ol start="20"><li>Socket Attachment Effect Settings</li></ol></td><td><ul><li>Add a Part under the ActionSequence, then add a VFXPreset under the Part.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FFvOpE1Qd7pskS5oUWQav%2Fimage.png?alt=media&#x26;token=c2de8cf1-426e-4684-8c99-172fbc3974e0" alt=""></li><li>Rename the Part to HandFXPart, and the VFXPreset to HandFX.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FGE35ggIznhc8RJHuBQU1%2Fimage.png?alt=media&#x26;token=8232790e-03e0-49e9-b4e5-4e9c71eede32" alt=""></li><li>Set CanCollide of HandFXPart to false, and Transparency to 1.</li><li>Change the appearance of HandFX to Energy Pulse, and set Enabled to false.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FymA3ziIJRGcPQTlKWo7m%2Fimage.png?alt=media&#x26;token=de304b66-a854-4d95-ae19-3b92e8f075a5" alt=""></li><li>Add a Control Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2Fh1vBOqBegL38khkiciqP%2Fimage.png?alt=media&#x26;token=0818e344-8887-4eb6-9ee0-a681f58c78b9" alt=""></li><li>In the Ref Object field, click the reference link button, then select HandFXPart in the Level Browser.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FLFmJy190VHVo6lLf9lM4%2Fimage.png?alt=media&#x26;token=c3c61848-c9fe-4f5b-a6b4-6109094a9eb0" alt=""></li><li>Change the Socket Name to LeftHand.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FVjtwzus8C333OtWOeaNg%2Fimage.png?alt=media&#x26;token=5c352a95-258b-47f2-8bfd-b5b0c86ff730" alt=""></li><li>Expand all Control Tracks so that the Value field of HandFX under HandFXPart is visible.</li><li>In the Value area of the timeline, click the mouse wheel or use Ctrl + left-click to add a keyframe.</li><li>Select the keyframe and set the Time field to 0.<br>(If the Value field is not false, set it to false.)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FPIbbO6gAAvPiVK0Dab4P%2Fimage.png?alt=media&#x26;token=c13e9c88-f99b-415e-8931-5852715fc562" alt=""></li><li>Insert a keyframe at the timing when the 2nd hit animation ends, and set the Value field to true.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FXy9UavVJzX4JEGT9KWMI%2Fimage.png?alt=media&#x26;token=d19fadcf-8e71-4861-9355-80e9cc8a76b1" alt=""></li><li>Insert a keyframe at the timing when the 3rd hit effect plays, and set the Value field to false.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2Ft6hebI2tabWGzNJ03hDT%2Fimage.png?alt=media&#x26;token=a37a5386-74dd-488f-b2b6-0dd0e6d4c8e6" alt=""></li><li>Move the scrubber to check whether the creation and disappearance timing of HandFX looks natural and adjust it.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FERTc3UhH2jRI7sPRiVGj%2Fimage.png?alt=media&#x26;token=d05941b1-0414-470e-bc3f-afcb47e8120d" alt=""></li><li>Save your work.</li></ul></td><td></td></tr><tr><td><ol start="21"><li>Camera Shake Track</li></ol></td><td><ul><li>Add a CameraShake Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FyWbKAxvPBqh3rVws40Cw%2Fimage.png?alt=media&#x26;token=1a44ae99-a166-4c1b-8726-2ddaf8c7d1a2" alt=""></li><li>Click the Edit Camera / Character Camera View Toggle button.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2Ft4rGgpRPlCspoTaBGQXi%2Fimage.png?alt=media&#x26;token=41a1e4d4-11af-4671-b523-d0cf408eb378" alt=""></li><li>Change the Shake Type of the CameraShake Track to Ultimate.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FSzdBSw0y6NTYCSWoOUeL%2Fimage.png?alt=media&#x26;token=6221c69a-42b0-49d6-8f4b-3bb3bf1da188" alt=""></li><li>Move the scrubber and adjust the section position to match the timing when the 3rd hit effect is played.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F5tAi6OG656jwhscM23y4%2Fimage.png?alt=media&#x26;token=0c74b45a-ce18-4e7d-b635-84dc7a6ad7ff" alt=""></li><li>Play the timeline to check whether the camera shake looks natural, and adjust the section position and length.</li><li>Click the Edit Camera / Character Camera View Toggle again to return to the default camera.</li><li>Save your work.</li></ul></td><td><ul><li>To preview camera-related tracks (Camera Shake, Camera FOV, Camera Zoom, etc.), you must switch the view using the <strong>Edit Camera / Character Camera View Toggle</strong> button.</li><li>In Character Camera view, <strong>camera controls are disabled</strong>.</li><li>At runtime, camera effects are applied only to the player who executes the ActionSequence.</li></ul></td></tr><tr><td><ol start="22"><li>Trigger Track</li></ol></td><td><ul><li>Add a Trigger Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FLVmLFm9irgYR4tM3t86z%2Fimage.png?alt=media&#x26;token=f58edda4-e343-4558-a895-d4d393a25389" alt=""></li><li>Adjust the section position and length to match the duration of the 3rd hit animation.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2Fb3tSSelkIeZWg3zKrzTp%2Fimage.png?alt=media&#x26;token=c63d9b56-3520-4295-9d28-89b75336fc7c" alt=""></li><li>Change the Trigger Name field to MovementStateControl.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FCEHfmwECefdnZdMve8jj%2Fimage.png?alt=media&#x26;token=99e8b006-abeb-486f-8af6-dd2ad2839054" alt=""></li><li>Add a LocalScript under the ActionSequence and rename it to TriggerTrackScript.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FaKYNqnpbAthxxOwwBmx5%2Fimage.png?alt=media&#x26;token=6b1c50b3-eaf5-41c6-b3de-b28999049993" alt=""></li><li><p>Open the script and write the following to control the player state:</p><pre class="language-lua"><code class="lang-lua">local Sequence = script.Parent

local Players = game:GetService("Players")
local StarterGui = game:GetService("StarterGui")

local LocalPlayer = Players.LocalPlayer

local InitWalkSpeed = nil
local InitJumpHeight = nil

local function SetMovementState(humanoid, state)
local toWalkSpeed = state == false and 0 or InitWalkSpeed
local toJumpHeight = state == false and 0 or InitJumpHeight

```
humanoid.WalkSpeed = toWalkSpeed
humanoid.JumpHeight = toJumpHeight

StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Joystick, state)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.JumpButton, state)

print("SetMovementState : ", state)
```

end

Sequence:TriggerStarted("MovementStateControl"):Connect(function(self)
if self \~= LocalPlayer.Character then
return
end

```
local humanoid = self:WaitForChild("Humanoid")
if InitWalkSpeed == nil or InitJumpHeight == nil then
    InitWalkSpeed = humanoid.WalkSpeed
    InitJumpHeight = humanoid.JumpHeight
end

SetMovementState(humanoid, false)
```

end)

Sequence:TriggerEnded("MovementStateControl"):Connect(function(self)
if self \~= LocalPlayer.Character then
return
end

```
local humanoid = self:WaitForChild("Humanoid")
SetMovementState(humanoid, true)
```

end) </code></pre></li></ul></td><td></td></tr><tr><td><ol start="23"><li>Clean Up Playback Duration</li></ol></td><td><ul><li>Move the scrubber to the point where the 3rd hit animation ends.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FtuOLLN57p8o4psYsfkj5%2Fimage.png?alt=media&#x26;token=e64bf5d2-cabe-4fe2-b268-df7cf64a36e4" alt=""></li><li>Click the playback duration setting button to adjust the playback end position to match the actual action length.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FmhezBmeu4KUeVa30iekw%2Fimage.png?alt=media&#x26;token=9f7912db-5080-41d6-a2d6-62380e9669b3" alt=""></li><li>Save your work.</li></ul></td><td><ul><li>To clearly define the creation and destruction timing of duplicated instances generated during ActionSequence execution, it is recommended to also clean up the playback duration when the action ends. <strong>If the playback duration is unnecessarily long, the removal of instances may be delayed.</strong></li></ul></td></tr><tr><td><ol start="24"><li>Verify Result</li></ol></td><td><ul><li>Run a play test and verify the result.<br>(When the 3rd hit animation is executed, check whether movement is disabled until the playback ends.)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F2uqT2Ksj6Ju1G2YGb4In%2Fimage.png?alt=media&#x26;token=b7e6aa1c-1343-429e-8860-62a78e879ebe" alt=""></li></ul></td><td></td></tr></tbody></table>

## Hit Reaction

### Learning Outcomes

<figure><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FZvWczhWdrKMOnELoDEdn%2FAseqGif3.gif?alt=media&#x26;token=45291930-4328-443a-8cb3-48071ea31517" alt=""><figcaption></figcaption></figure>

By completing this tutorial, you will be able to create the following setup:

* Play hit reaction upon successful attack
* Hit effect that plays in sync with the impact timing

### Asset List

<table><thead><tr><th width="140.9998779296875">Asset Type</th><th width="229">Asset ID</th><th>Description</th></tr></thead><tbody><tr><td>Animation</td><td>ovdrassetid://18178100</td><td>Hit</td></tr></tbody></table>

### Tutorial

<table data-full-width="true"><thead><tr><th width="233.33331298828125">Step</th><th width="590">Task</th><th>Notes</th></tr></thead><tbody><tr><td><ol><li>Create ActionSequence</li></ol></td><td><ul><li>Add an Action Sequence instance under the ActionSequenceService.</li><li>Rename it to HitReaction.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FQXasdrqxvYRtRugrhwgj%2Fimage.png?alt=media&#x26;token=0ad6e972-953a-4901-8013-d31fe6730475" alt=""></li></ul></td><td><ul><li>The Action Sequence name must be unique.</li></ul></td></tr><tr><td><ol start="2"><li>Open ActionSequence Editor</li></ol></td><td><ul><li>Hover over the Action Sequence instance and click the Open button that appears.</li></ul></td><td><ul><li>Changes made during play mode are not applied immediately and will take effect after restarting.</li></ul></td></tr><tr><td><ol start="3"><li>Animation Track</li></ol></td><td><ul><li>Click the Add Track button to add an Animation Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FXM8andr3mURbUVlUNiYN%2Fimage.png?alt=media&#x26;token=1e42decc-200e-47c0-bb9f-95be8d484666" alt=""></li><li>Set the Ovdr Asset ID to the animation ID for the 1st hit.<br>(ovdrassetid://18178100)</li><li>Set Blend In / Out Time to 0.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F4uBDc28qLTpNvUfyXl32%2Fimage.png?alt=media&#x26;token=9c6e7b12-cc9e-42cb-88ac-b5d4afe661cf" alt=""></li><li>Adjust the playback duration to match the actual animation length.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FTNAwHXjIRBtw1NdSEnug%2Fimage.png?alt=media&#x26;token=62f4e47a-70c4-4a93-ba74-b5ebc9f264ee" alt=""></li></ul></td><td><ul><li>Press F to fit the timeline to the playback duration.</li></ul></td></tr><tr><td><ol start="4"><li>Preview</li></ol></td><td><ul><li>Press the Play button or Spacebar to play the timeline and check the animation.</li><li>Save your work.</li></ul></td><td></td></tr><tr><td><ol start="5"><li>Run ActionSequence</li></ol></td><td><ul><li><p>In the LocalScript under<br>StarterPlayer.StarterCharacterScripts,<br>add the following code created while making the 3-hit combo action:</p><pre class="language-lua"><code class="lang-lua">-- (continued from previous content)
local PlayButton2 = Instance.new("TextButton")
PlayButton2.Position = UDim2.new(0.5, 0, 0.1, 60)
PlayButton2.Text = "Play HitReaction"
PlayButton2.TextScaled = true
PlayButton2.Parent = ScreenGui

PlayButton2.Activated:Connect(function()
local character = LocalPlayer.Character
local humanoid = character:WaitForChild("Humanoid")
local actionRunner = humanoid:GetActionRunner()

```
local key = "HitReaction"
local transitionTime = 0
actionRunner:Play(key, transitionTime)

print("Play : " .. key)	
```

end) </code></pre></li><li>Run a play test.</li><li>Click the Play HitReaction button to execute the Action Sequence and verify that the action plays.</li><li>End the play test.</li></ul></td><td><ul><li>Action Sequences can also be executed in a LocalScript.</li></ul></td></tr><tr><td><ol start="6"><li>Configure Effects</li></ol></td><td><ul><li>Add a Part under the Action Sequence, then add a VFXPreset under the Part.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FTs4E3eHpJyblWeeAv7gf%2Fimage.png?alt=media&#x26;token=f69d9d3c-f3d6-4363-a955-2a286c678358" alt=""></li><li>Rename the Part to ReactionFXPart, and the VFXPreset to BloodFX.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FUF5Ld5wKSUqL9zjlzcMp%2Fimage.png?alt=media&#x26;token=f86f9ac3-f5a6-4b5d-b95a-bcf384404aa3" alt=""></li><li>Set CanCollide of ReactionFXPart to false, and Transparency to 1.</li><li>Change the appearance of BloodFX to Blood, and set Enabled to false.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FimIQlVFEoIUB1LG7cTgZ%2Fimage.png?alt=media&#x26;token=dbaf7ac3-834b-4698-a301-63e1cb79126f" alt=""></li><li>Add a Control Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FeWrV3pfzZKC7Rks5w4cw%2Fimage.png?alt=media&#x26;token=b3beaff9-bc2c-427a-9402-dc18f8d6117b" alt=""></li><li>In the Ref Object field, click the reference link button, then select ReactionFXPart in the Level Browser.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FLCJoguiDUV8ASJtMJKhx%2Fimage.png?alt=media&#x26;token=8b101d91-e7cd-4968-83c3-053e68caf8a8" alt=""></li><li>Expand all Control Tracks so that the Value field of BloodFX is visible in the track list.</li><li>Add a keyframe in the Value area of the timeline.</li><li>Select the keyframe and set the Time field to 0.<br>(If the Value field is not false, set it to false.)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F9W9TwKzWjQeKklKhUxSu%2Fimage.png?alt=media&#x26;token=82f72ba6-a753-44ad-b89a-defb3f7b7305" alt=""></li><li>Add another keyframe at the desired timing and set the Value to true.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FumA3jjF4HD2bKmncO9Vb%2Fimage.png?alt=media&#x26;token=5c909a5c-049e-41a8-9580-9cb5a5d006ab" alt=""></li><li>Click the Control Track and change the Relative Location field to (0, 100, 0).<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FBrxRiDbmcO56wNKcDVfY%2Fimage.png?alt=media&#x26;token=767cc431-cecf-4f5b-9624-b850c34069eb" alt=""></li><li>Move the scrubber to check and adjust the effect position naturally.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FSJ4omWH3TSW1Fsm63m9o%2Fimage.png?alt=media&#x26;token=5a7cefad-7865-4d01-a95c-42e62d0c7294" alt=""></li><li>Save your work.</li></ul></td><td></td></tr><tr><td><ol start="7"><li>Play Hit Reaction on Attack Hit</li></ol></td><td><ul><li>Open the CollisionTrackScript under the 3-HitCombo Action Sequence.</li><li><p>Add the following code below <code>target.Health -= 40</code>:</p><pre class="language-lua"><code class="lang-lua">target.ActionRunner:Play("HitReaction") </code></pre></li></ul></td><td></td></tr><tr><td><ol start="8"><li>Verify Result</li></ol></td><td><ul><li>Run a play test.</li><li>Move Player1’s character in front of Player2’s character, then press the Play 3-Hit Combo button to execute the Action Sequence. Verify that the hit reaction plays each time an attack lands.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FBa7VuELo3qRSdrANBggI%2Fimage.png?alt=media&#x26;token=2316e44e-705d-401f-a8c0-8a832f42f4ce" alt=""></li></ul></td><td></td></tr></tbody></table>

## Healing Action

### Learning Outcomes

<figure><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FmwFa9BOaR4ucNWdTUL4J%2FAseqGif4.gif?alt=media&#x26;token=3896fb2d-2275-4d88-a66d-c20756dd492e" alt=""><figcaption></figcaption></figure>

By completing this tutorial, you will be able to create the following setup:

* Healing Effect Presentation
* Handle events at specific timings by using the Event Track.

### Asset List

<table><thead><tr><th width="140.9998779296875">Asset Type</th><th width="229">Asset ID</th><th>Description</th></tr></thead><tbody><tr><td>Animation</td><td>ovdrassetid://18884200</td><td>Spell Casting</td></tr></tbody></table>

### Tutorial

<table data-full-width="true"><thead><tr><th width="233.33331298828125">Step</th><th width="590">Task</th><th>Notes</th></tr></thead><tbody><tr><td><ol><li>Create ActionSequence</li></ol></td><td><ul><li>Add an ActionSequence instance under the ActionSequenceService.</li><li>Rename it to HealSpell.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FrdBtNTTXLpfbHkoupT01%2Fimage.png?alt=media&#x26;token=9ff448d3-aaee-475b-be90-d54e68b51fe0" alt=""></li></ul></td><td><ul><li>The ActionSequence name must be unique.</li></ul></td></tr><tr><td><ol start="2"><li>Open ActionSequence Editor</li></ol></td><td><ul><li>Hover over the ActionSequence instance and click the Open button that appears.</li></ul></td><td><ul><li>Changes made during play mode are not applied immediately and will take effect after restarting.</li></ul></td></tr><tr><td><ol start="3"><li>Animation Track</li></ol></td><td><ul><li>Click the Add Track button to add an Animation Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FLN7ircUPiscpzqzXvAHj%2Fimage.png?alt=media&#x26;token=99825692-0186-4d84-a5ae-ffb1df263ea8" alt=""></li><li>Set the Ovdr Asset ID to the animation ID for the 1st hit.<br>(ovdrassetid://18884200)</li><li>Set Blend In / Out Time to 0.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FjTdNo281fyUiPJIyLOYF%2Fimage.png?alt=media&#x26;token=f77ff226-6267-4632-b1b8-439c752fe219" alt=""></li><li>Change the Slot Type to Upper Body.</li></ul></td><td></td></tr><tr><td><ol start="4"><li>Preview</li></ol></td><td><ul><li>Press the Play button or Spacebar to play the timeline and check the animation.</li><li>Save your work.</li></ul></td><td></td></tr><tr><td><ol start="5"><li>Run ActionSequence</li></ol></td><td><ul><li><p>In the LocalScript under<br>StarterPlayer.StarterCharacterScripts,<br>add the following code created while making the 3-hit combo action:</p><pre class="language-lua"><code class="lang-lua">-- (continued from previous content)
local PlayButton3 = Instance.new("TextButton")
PlayButton3.Position = UDim2.new(0.5, 0, 0.1, 120)
PlayButton3.Text = "Play HealSpell"
PlayButton3.TextScaled = true
PlayButton3.Parent = ScreenGui

PlayButton3.Activated:Connect(function()
local character = LocalPlayer.Character
local humanoid = character:WaitForChild("Humanoid")
local actionRunner = humanoid:GetActionRunner()

```
local key = "HealSpell"
local transitionTime = 0
actionRunner:Play(key, transitionTime)

print("Play : " .. key)	
```

end) </code></pre></li><li>Run a play test.</li><li>Click the Play HealSpell button to execute the ActionSequence and verify that the action plays.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FGpmQmckQOp3CdoK0kWxh%2Fimage.png?alt=media&#x26;token=f4558135-e08f-4d48-9427-640f5ef0fc7b" alt=""></li><li>End the play test.</li></ul></td><td><ul><li>ActionSequence can also be executed in a LocalScript.</li></ul></td></tr><tr><td><ol start="6"><li>Configure Effects</li></ol></td><td><ul><li>Add a Part under the ActionSequence, then add a VFXPreset under the Part.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FFU4U3zrp0pwVvtOM056r%2Fimage.png?alt=media&#x26;token=b9faaa69-cff6-48fd-9064-3d9f2c271c4c" alt=""></li><li>Rename the Part to HealFXPart, and the VFXPreset to HealFX.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FGNzKaOizHq7Ny0erOUIj%2Fimage.png?alt=media&#x26;token=438fa6d0-6295-4fca-b066-bd534cf70ba6" alt=""></li><li>Set CanCollide of HealFXPart to false, and Transparency to 1.</li><li>Change the appearance of HealFX to Heal, and set Enabled to false.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2Fkz6ZuUqKqcpVJiW2yJ2p%2Fimage.png?alt=media&#x26;token=580f86e7-bbb2-4429-9ce5-377cd6b1f011" alt=""></li><li>Add a Control Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FtMwzTApylt9snSCoqGo5%2Fimage.png?alt=media&#x26;token=f5ed1885-1ffd-477a-9b3a-6b6449c0a783" alt=""></li><li>In the Ref Object field, click the reference link button, then select HealFXPart in the Level Browser.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F04kMLy3OvPIZukMV02Kk%2Fimage.png?alt=media&#x26;token=eee568ea-2c90-46df-9061-5de912f8e3d6" alt=""></li><li>Expand all Control Tracks so that the Value field of HealFX is visible.</li><li>Add a keyframe in the Value area of the timeline.</li><li>Select the keyframe and set the Time field to 0.<br>(If the Value field is not false, set it to false.)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FWE7rCm3V0FyOjaeDf0sp%2Fimage.png?alt=media&#x26;token=93e06a79-3783-4995-a505-cdf212855a3b" alt=""></li><li>Add a keyframe at the timing when the animation ends, and set the Value field to true.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FhGXvWPwHtNhkQo7x5gBw%2Fimage.png?alt=media&#x26;token=e1b1cf69-46e8-4c26-be01-08613a92e22b" alt=""></li><li>Move the scrubber to check whether the effect position looks natural and adjust it if necessary.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FrARipCQlo9FiEDm2otCj%2Fimage.png?alt=media&#x26;token=2f2e6809-fa44-4ba2-9bc7-04dd20f1070c" alt=""></li><li>Save your work.</li></ul></td><td></td></tr><tr><td><ol start="7"><li>Set Playback Duration</li></ol></td><td><ul><li>Place the scrubber at 2 seconds and adjust the playback duration.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2Fwk8ZjDFMf6Ivzk6XfLla%2Fimage.png?alt=media&#x26;token=eb6bf07d-bd15-4f9e-90eb-bba2b1e20d10" alt=""></li></ul></td><td></td></tr><tr><td><ol start="8"><li>Event Track</li></ol></td><td><ul><li>Add an Event Track.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FR1uf1sq8bSW6gZYyPW3r%2Fimage.png?alt=media&#x26;token=8714624a-c638-423b-af75-893d70ed1023" alt=""></li><li>Expand the Event Track so that the Value field is visible.</li><li>Add four keyframes after the last keyframe of the Control Track.<br>(These keyframes will be used in the script for healing processing.)<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FkLq4cttvPojWVb3Ejq1j%2Fimage.png?alt=media&#x26;token=ed166b75-c536-4404-acc6-a779ab6c0a03" alt=""></li><li>Set the Collision Event Name of each keyframe to:<br>Heal1, Heal2, Heal3, Heal4<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F65K4gJF7CuZmidWsEbyr%2Fimage.png?alt=media&#x26;token=80398cb3-dcc3-4634-bb0f-2f667d94ad59" alt=""></li><li>Save your work.</li><li>Add a Script under the ActionSequence and rename it to EventTrackScript.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2FRkWGAFeT5lF8yLtsYWCg%2Fimage.png?alt=media&#x26;token=bf89d2c6-5802-4e72-8488-0ba4ca185320" alt=""></li><li><p>Open the script and write the following to control the behavior:</p><pre class="language-lua"><code class="lang-lua">local ActionSequence = script.Parent

local HealAmount = 20

for i = 1, 5 do
ActionSequence:GetMarkerReachedSignal("Heal" .. i):Connect(function(self)
local humanoid = self:WaitForChild("Humanoid")
humanoid.Health += HealAmount
print("Health : ", humanoid.Health, " / ", humanoid.MaxHealth)
end)
end </code></pre></li></ul></td><td></td></tr><tr><td><ol start="9"><li>Verify Result</li></ol></td><td><ul><li>Run a play test and verify the result.<br><img src="https://2064130887-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhrvYlLq1mQAq0V0vwPsb%2Fuploads%2F3Egzl8dDODp1jlcSR9ql%2Fimage.png?alt=media&#x26;token=37e2fb93-fb0e-44c2-aab0-d163efbfa1c0" alt=""></li></ul></td><td></td></tr></tbody></table>

## Learning Materials

{% content-ref url="actionsequence-mechanism" %}
[actionsequence-mechanism](https://docs.overdare.com/manual/studio-manual/game-development/actionsequence/actionsequence-mechanism)
{% endcontent-ref %}

{% content-ref url="actionsequence-track-types" %}
[actionsequence-track-types](https://docs.overdare.com/manual/studio-manual/game-development/actionsequence/actionsequence-track-types)
{% endcontent-ref %}

## Useful Resources

{% content-ref url="../../character/character-animation" %}
[character-animation](https://docs.overdare.com/manual/studio-manual/character/character-animation)
{% endcontent-ref %}

{% content-ref url="../../object/vfx/vfxpreset-asset-list" %}
[vfxpreset-asset-list](https://docs.overdare.com/manual/studio-manual/object/vfx/vfxpreset-asset-list)
{% endcontent-ref %}
