Hey,
I’m pretty new to Javascripting and unity. tried to watch tutorials and such, but I don’t understand how I can connect my script to change animation.
I got a Animator connected to my Player which is called Player.
Parameter (Int) → tore
idle = 0
run = 1
I tried this script but I get errors, I have also tried different scritps but I’m pretty stuck.
Any ideas?
#pragma strict
function Start () {
private Animator animator;
}
function Update () {
// var AT = gameObject.GetComponent(AnimateTexture);
if (Input.GetKey ("a")) {
animator.SetInteger("tore", 1);
} else if (Input.GetKey("d")) {
animator.SetInteger("tore", 1);
} else {
animator.SetInteger("tore", 0);
}
}