my animation doesn’t seem to be working and guys pls help.
i have created a animation and did my script part and the all damn thing just does not work.
#pragma strict
var Effect : Transform;
var TheDammage = 100;
var CM901 : Transform;
function Update () {
var hit : RaycastHit;
var ray : Ray = Camera.main.ScreenPointToRay(Vector3(Screen.width*0.5, Screen.height*0.5, 0));
if (Input.GetButtonDown("Fire1"))
{
animation.Play("CM901Shooting");
if (Physics.Raycast (ray, hit, 100))
{
var particleClone = Instantiate(Effect, hit.point, Quaternion.LookRotation(hit.normal));
Destroy(particleClone.gameObject, 2);
hit.transform.SendMessage("ApplyDammage", TheDammage, SendMessageOptions.DontRequireReceiver);
}
}
}