Increase the speed of one animation?

I’m trying to make one animation play faster I’ve tried this code`using UnityEngine;
using System.Collections;

public class Attack : MonoBehaviour {
private Animator m_Animator;
public UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter ThirdPersonCharacter;
// Use this for initialization

void Start () {
    m_Animator = GetComponent<Animator>();
}

// Update is called once per frame
void Update () {
    m_Animator.speed = 2f;
    if (Input.GetKeyDown(KeyCode.Q))
    {
        m_Animator.Play("WAIT04");
    }
}

}`
But his increases the speed of all animations. I’ve tried moving the speed statement inside the if statement and setting speed equal to 1 otherwise but that set all animations back to 1. How do I make just the WAIT04 animation play faster?
Thanks for any help.

You can do something like

 if(m_Animator.GetCurrentAnimatorStateInfo(0).IsName("WAIT04"))
{
     m_Animator.speed = 2f;
}
else
{
     m_Animator.speed = 1f;
}

I mean it works for sure if you use mechanim animator parameters etc. but it should work just fine with Play() :slight_smile: also you can just go to your animator, select your animation and change “Speed” value.

I figured out how to do it in the animator right after I posted the question. Thanks though.