Animating in c#
Is there a way to play a animation that i've created by calling it from a script? instead of using the animator? if yes can you give me a simple example?
Answer by Zoogyburger · Feb 19, 2016 at 07:09 PM
How do you want your animation to play? You might want it to play after the player presses a button or something. This might help http://docs.unity3d.com/ScriptReference/Animation.Play.html
here's an example:
if(Input.GetKeyDown("e")){
animation.Play("animation");
}
i tried to do as you said and pasted the code, but it automatically changed the code to the following:
GetComponent().Play();
And there is no box in the Inspector to put the animation in
Your answer
Follow this Question
Related Questions
AnimationOverrideController does not set clip. 1 Answer
change player position when animation in played 0 Answers
Why isn't my animation looping? 3 Answers
Animation Constantly Playing? 1 Answer