- Home /
First person controller animation problem
Is there a way for me to join my models animations with the FPS controller without using a separate script to play the animations so when i press W and the FPS controller moves forward, the model (i replaced the capsule with my model) moves with the Fps controller while playing its run animation. Same with pressing A, D and S so for example when someone presses D the model turns 90 degrees from looking forward and then moves in D's direction (in the fps controller, right). I tried doing this in another script but it didnt work :
if(Input.GetKeyDown(KeyCode.D)) { animation.CrossFade("Run"); transform.Rotate(0,90,0); } if(Input.GetKeyUp(KeyCode.D)) { animation.CrossFade("Standing"); transform.Rotate(0,-90,0); }
I want to have the code playing the animations in the same script as the FPS controllers movement script and where in the movement script it says to move in directions put the animations there. So where it says to move forward make the model move forward with FPS controller and play the 'Run' animation. Can someone help
I'm curious, how is this different from your other question? : http://answers.unity3d.com/questions/708363/how-to-link-up-animations-with-the-first-person-co.html
Well no one answered it and its really bugging me and can you help me ins$$anonymous$$d of asking things that aren't exactly necessary. Please im really struggling with this.
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Model stays at the end of my animation D:? 0 Answers
Access Variable From FirstPersonController Script 1 Answer
Position of GameObject changes when animating 2 Answers
Multiple Cars not working 1 Answer