- Home /
BEGINNER QUESTION: is there any way to improve this script in order to get the animation working properly???
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);
}
}
}
Comment
Answer by chrisall76 · Apr 24, 2014 at 04:55 AM
Ok, let's see some things.
1.Does the object you have the script on also have a animation component?
2.If it does, did you assign it that animation
3.did you enter the name correctly?
Doesn't seem to be any problems script-wise
Your answer
Follow this Question
Related Questions
animation doesn't work??? 1 Answer
animation does not WORK!! part 2 0 Answers
Animation not working? 0 Answers
Changes applied to whole area?? 1 Answer