Weapon Switch Animations

Hello

I have the weapon switching script from the unity fps tutorial but I want to make some modifications to it.

Basically I want a weapon animation to play when I select that weapon (For example, a gun appearing into view, etc..)

At the moment the weapon switching script is attached to a gameobject and both of my weapons are parented to that gameobject.

I've tried to play the gun animation from the weapon switch script but that didn't work.

I've also tried to have the gun script get a boolean from the weapon switch script but that didn't work either

Thanks for your help

if(input.getkey(ā€œgā€)
{

   animation.play("animation name")
}

try this :D