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???

1 Answer

1

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", PlayMode.StopAll ); } Hi, HunterKrech, 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

–

@HunterKrech i think you are not getting it. I am asking that can i use Maya 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 Kar, 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 Maya.

–

@Esterelle, have you imported and applied the animation correctly??

–