Hi guys-
I'm a real noob (never done a Java script before) and I'm trying to work out where I made some mistakes here in getting my animation to work.
Here is the code that I'm using...
#pragma strict
private var speed: float = 0.2f;
static var anim: Animator;
function Start ()
{
anim = gameObject.GetComponent (Animator);
}
function Update ()
{
if (Input.GetKey("space"))
{
anim.SetTrigger("jump");
}
{
else if(Input.GetKey("left"))
}
this.transform.Rotate(Vector3.up, -1);
}
else if(Input.GetKey("right"))
{
this.transform.Rotate(Vector3.up, 1);
}
if(Input.GetKey("up"))
{
this.transform.position += this.transform.forward * speed;
anim.SetBool ("isWalking", true);
}
else if(Input.GetKey("down"))
{
this.transform.position -= this.transform.forward * speed;
anim.SetBool ("isWalking", true);
}
else if (Input.GetKeyUp("up") || Input.GetKeyUp ("down"))
{
anim.SetBool ("isWalking", false);
}
}
This are the errors I get...![alt text][1]
And I got the instructions on the animation from this document:
[http://files.holistic3d.com/Tutorials/CharacterController.pdf][2] (pgs 11 & 12 of the pdf)
Any assistance you could give would be appreciated. I'm pretty stuck here.
Thanks!!!
[1]: /storage/temp/87231-animerrors.png
[2]: http://files.holistic3d.com/Tutorials/CharacterController.pdf
↧