ot;Sword Attack&quot;).SetOnFrame(&quot;Slash&quot;, OnSwordSlash);
}

private void OnSwordSlash(Frame frame)
{
    Debug.Log(&quot;Slash frame played&quot;);
    // Check colisions and deal damage.
}
</code></pre>
<p><strong>When the animation ends:</strong></p>
<p>You can define an action to be fired when the animation ends (upon last frame being played) using the <code>SetOnEnd()</code> method:</p>
<pre><code class="lang-csharp">public void PlayDeath()
{
    _animator.Play(&quot;Death&quot;).SetOnEnd(Ann