- Home /
Problem is not reproducible or outdated
Setting up animator
Okay, so... I solved my last question and i am about to accept the answer.
Anyway, i have some nice animations for my character, but i am having a problem. As i said before, i am a horrible animator, and i always tried to avoid the animator, but i have no chance, i am going to make something complex.
I am using the First Person Character, and i am using a rigged model as it's body/corpse. I also have all the animations (dying,walking,jumping,etc...). The problem is that i don't know how to setup the animator.
Could someone write a tutorial for me or something? Please don't just link a page or video. I wanted to learn how to make for an example:
If player is holding W, then continue making the forward walking animation. If he stopped, then make the stop walk animation.
Could someone help me? I would really appreciate if someone could help me on this. Oh, and i am using animator, i am NOT using animation clips.
"Could someone write a tutorial for me or something? Please don't just link a page or video". There are plenty of good tutorials already out there, like this or this, not to mention the manual. Why should anyone spend time and effort rewriting the same information all over again just for you? It creates no new knowledge, makes additional noise, and takes time and attention away from answering other questions on this site, generally making UA less useful for everyone.
Answer by iAmAwsum · Nov 04, 2016 at 09:10 PM
Add an Animation Component to your Player then in the script:
if(Input.GetKey(KeyCode.W)) {
gameObject.GetComponent<Animation>().Play("WalkAnim");
}
if(!Input.GetKey(KeyCode.W)) {
gameObject.GetComponent<Animation>().Stop("WalkAnim");
}
Also don't forget to go into Debug mode in Unity and set your animations into Legacy mode.
This is a very basic code just to demonstrate what you can do. You can also use Animation Events. Event System
The problem is that everytime i do this my animations get deleted.
Follow this Question
Related Questions
Help with Unity 3D animator (3D game) 0 Answers
Losing Animator state on Disable/Re-enable? 0 Answers
Realistic walking. 1 Answer
Unity freezes when I run animation. How do I fix this? 1 Answer
Animation Impulse System? 1 Answer