I’m trying to make an FPS with mecanim. I want to make it so my shooting animation can fires as fast as I can click. I’m using Input.GetButton(“Fire1”) instead of getbuttondown to test how fast it can shoot. It doesn’t seem to be restarting the shooting animation fast enough, though. I want to know if I’m going about it the right way, and what the best way to make it go as fast as I can click is.
Here’s my state machine: http://i.imgur.com/ylEvQa1.jpg And here’s the script I’m currently using:
currentBaseState = anim.GetCurrentAnimatorStateInfo(0);
if(Input.GetButton("Fire1"))
{
anim.SetBool("Shot",true);
Shoot();
}
if(currentBaseState.nameHash == shootState)
{
anim.SetBool("Shot", false);
MuzzleFlashRenderer.enabled = false;
ShootLight.enabled = false;
}