Question by
jjkrr · May 19, 2019 at 02:00 AM ·
animatoranimationclip
Character animation restarts every frame
I'm trying to get a player animation to play once when a key is pressed, but the clip restarts every frame infinitely when the key is pressed once. I have everything set up in the mecanim, and the script assigned to the player.
Here's my script:
public class Character_Bow_Script : MonoBehaviour {
public Animator animator;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.J))
{
animator.SetTrigger("Bow");
}
}
}
Thanks
Comment
Your answer
