- Home /
Question by
Gameart1235 · Nov 18, 2013 at 09:30 PM ·
animation2danimatorplayer
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);
}
Comment
Answer by flaviusxvii · Nov 18, 2013 at 11:04 PM
in javascript.. variable declarations go like this
var <NAME> : <TYPE>
And up above you've done
var <TYPE> : <NAME> for your speed variable..
Your answer
![](https://koobas.hobune.stream/wayback/20220613122151im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2D Animation does not start 1 Answer
Best way to do animate soldier? 1 Answer
How to make not smooth animation? 0 Answers
OnTriggerStay2D Breaks When Adding AnimationController 1 Answer
Scale animation doubt 0 Answers