- Home /
Play animation serially imported from Maya to Unity
Hi Guys, I am using unity pro but i am stuck in a place. I am making an FPS. and i want my ally to run around, take cover at places and do lots of stuffs like that. I am animating the movements and actions in Maya. But can apply them in a particular order in Unity throughout the level of my game. And if yes how can i cross-fade them???
Answer by HunterKrech · Mar 26, 2013 at 05:52 AM
yes, you can play them in a particular order. for example say your enemy was just walking around, and you wanted him to take cover when you started shooting. You could have cover spots with triggers all over the place and say something like
OnTriggerEnter(collider building)
{
if(building.gameObject.name == "sandbagsCover") {
animation.Play("duck");
}
}
clearly this is not exactly what you would do every time, but it should give you a rough idea.
Hope it helps!
private void Jump()
{
animation.Play( "jump", Play$$anonymous$$ode.StopAll );
}
Hi, Hunter$$anonymous$$rech, what if I did something like that, and when I run the scene, it says " There is no 'Animation' attached to the game object but a script is trying to access it "? What should I do?
Why are you using playmode.stopall?? i think that is the problem. though i am not sure
@Hunter$$anonymous$$rech i think you are not getting it. I am asking that can i use $$anonymous$$aya animations of a character(for example my ally) in a serialized way. For example, i want my ally to go from the starting point to a door, break it open and start firing. How can i make this happen??
@Rishav $$anonymous$$ar, because by default, my game object is already playing the "walking" animation. What should I do if I want to change the "walking" animation to the "jumping" animation through editing the script? All animations are done in Autodesk $$anonymous$$aya.
@Esterelle, have you imported and applied the animation correctly??
Your answer
Follow this Question
Related Questions
Can I make animations snap to a frame? 1 Answer
Maya animations are killing my framerate 2 Answers
about animation tab ? 1 Answer
1 FPS in Unity Timeline 0 Answers