# Animation Starts Before KeyDown Event Even Happens?

Recently when I started working on my first animation transition, it has a bug were the transition will occur as soon as the game begins, even though I haven't pressed the key to activate the transition. I would really appreciate any help I can get on this so I can continue creating more animations. I will include my C# code and an image of the transition below. Thanks, Nova

using UnityEngine;
using System.Collections;

public class PlayerAC : MonoBehaviour
{
private Animator anim;

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

void Update () {

if (Input.GetButton ("Fire1"))
{
anim.SetBool ("RunStright", true);
}
else
{
anim.SetBool ("RunStright", false);
}
}
}

• Do you have an animation component on the GameObject that is set to play automatically? – user91623 Sep 21 '16 at 16:17
• I don't believe so, but I did notice that when has exit time is checked it will run when I click it but, it will only work if I press the key before it reaches the duration line. When I have has exit time not checked it cause the main problem I stated in my question were it plays as soon as it reaches the duration line. – nova nanite Sep 21 '16 at 19:58

The default value of parameter RunStright is true, you can try unchecking it first before playing, i think this could help.