Basic animation has been made and using the following code to trigger the animation when gun is fired in game but the code doesn't seem to compile. It seems correct to me...
It responds in saying:
Assets/Code/GunAnimate.js(6,36): BCE0044: expecting ), found '{'
Assets/Code/GunAnimate.js(10,1): BCE0044: expecting EOF, found '}'
function Start(){
animation["GunAnimate"].wrapMode = WrapMode.Once;
}
function Update(){
//...
if(Input.GetButtonDown("Fire1"){//or whatever button
animation.Play("GunAnimate");
FireWeapon();
}
}