My animation doesn't run when using UIbutton,Animation doesn't run when I am using UIbutton
Hi,
My animation doesn't run when I am using my UIbutton, when I use space it fires the bullet and run the animation but if I use my UIButton it doesn't, both are calling the same firebullets method. All my other UIbuttons are working fine calling respective animations.
void FireBullets(){
if (canFire) {
anim.SetInteger ("State", 4);
//Makes the player fire bullets in the left direction
if (sprite.flipX) {
Instantiate (leftBullet, leftBulletSpawnPos.position, Quaternion.identity);
}
//Makes the player fire bullets in the right direction
if (!sprite.flipX) {
Instantiate (rightBullet, rightBulletSpawnPos.position, Quaternion.identity);
}
//Play the fire bullet audio when the player fires a bullet
AudioController.instance.FireBullets (gameObject.transform.position);
}
}
This is my firebullets method
Thank you
Comment
Your answer
Follow this Question
Related Questions
Coding click multiplier in C#. Help! 0 Answers
Options menu won't work 0 Answers
Sketchy looking buttons in android 0 Answers