Question by
nebulaisrighthere · Jun 20, 2018 at 11:52 PM ·
animationgun scriptgun-animation
*Animation Error Help*
Hi i'm animating a simple gun where it has it sound effect when it fires and animation too when you hit the mouse, the problem is that the animation inst working and i'm pretty stuck about this because to me it should work, If you find my error i will happy
Code:
{ if (Input.GetButtonDown("Fire1")) { AudioSource CSS_REALISTIC_ = GetComponent(); CSS_REALISTIC_.Play(); GetComponent().Play("AK_Gunfire_Ani(1)"); } } //CSS_REALISTIC_ = Audio/Gunshot //Ak_Gunfire_Ani(1) = GunAnimation
Comment
Answer by nebulaisrighthere · Jun 21, 2018 at 12:11 AM
if (Input.GetButtonDown("Fire1"))
{
AudioSource CSS_REALISTIC_ = GetComponent<AudioSource>();
CSS_REALISTIC_.Play();
GetComponent<Animator>().Play("AK_Gunfire_Ani(1)").Play();
}
}
The code missed up in the other comment