Gun Animate when it shoots

I’ve making a online FPS game by my self with 3 small levels.

i only have one gun, its the M9.
the only thing i need to make this gun look realistic, its a scripts that makes the gun amimate a certain animation when i click the fire button or the right mouse click

3-step tutorial covering the complete production of a first person shooter

SearchBarMagic

ohhh no its ok i got, i just have to make a script Gun_Anim and animation called Gun

function Update() {
    if(Input.GetButtonUp("Fire1"));
    animation.Play("Gun");
}

then apply the script and the animation to the gun object

I’m not that good at scripts and also just 12 years old.

  • Felipe

So instead of that script that works terrible use this one:

Enemy:



Then copy and paste this to the end of your health script:



You are free to make some changes.

  • Felipe