game object hide

hey im sorry this is maybe alreddy on the site but can`t find it please tell me what i did wrong this is a script for my fire light wehen i fire my gun gets a flikkering light animation that works but i want also when i stop firing that the game object licht call it ("new gun fire light"); disapears but wont work please help

The script

function Update() 

{

if( Input.GetButton( "Fire1" ) ) { animation.Play("new gun fire light"); } if( Input.GetButtonUp( "Fire1" ) ) { animation.Stop("new gun fire light"); } } else { if( Input.GetButtonUp( "Fire1" ) ) ("new gun fire light");.enabled = false; } }

thank you

"Enabled" is not available for GameObjects.

You should use this:

gameObject.active = false;