4.3 2D (Need help with Animator in java)

I’m making a 2D Game, and I need help on how to Animation my Player Sprite, so far I made a few Animation for him and set up his animator. What I need help with is how to play the animation. and get the Speed from the Parameters in the animator to equal my var Speed.

So far here my code

#pragma strict

var Speed : float = 10;
var anim : Animator;

function Start () {
anim = gameObject.GetComponment(Animator);
}

1 Answer

1

in javascript… variable declarations go like this

var <NAME> : <TYPE>

And up above you’ve done

var <TYPE> : <NAME> for your speed variable..

Speed isnt a type