How to Animate Environment Objects

I have been tasked with making a playable environment within a game engine for a class project. I am new to Unity, although I have been watching tutorials and using it for a few weeks. I have several years of experience working with Maya, and I have a basic understanding of the workflow between Maya and Unity. I already have environment objects completed with animation and have assembled the scene in Unity. The ambient objects that only require a portion of the object to rotate or translate work fine, such as a fan or a flag. However, when it comes to objects that move within the environment, I am not sure on the best approach to animation. I have a basic understanding of Mechanim, but I am not certain how this applies to animals or organic environment objects.

I have a crow with a basic wing flapping animation that I want to circle overhead in a loop. Would it be best to animate the translation and rotation using Unity’s tools and leave the Maya animation for the wing flapping?

In addition, I have an animated tumbleweed with a rotation and translation that I want to roll from one corner of the terrain to the other. However, the Maya animation only covers a short distance and looping the animation returns the object to its original location in 3d space to start again. Would I need to extend the Maya animation to cover the length of the level or is there a more efficient approach?

What is the best approach to animating environmental objects within Unity?

The best approach IMHO is to animate as much as you can with scripting. If something will be moving in a fixed way, you should animate its looping behavior relative to its own center and then move that center with an animation curve in Unity.

But It sounds like you’re still thinking inside the pre-rendered 3d animation box from your years of Maya experience.

The crow can come and go, it can perch on a tree and be scared off when the player arrives. The tumbleweed doesn’t need to roll across from point A to point B and loop; you can make tumbleweeds of all sizes and colors spawn randomly and roll by using rigidbody physics or even a particle system.

If the crow’s circling, it shouldn’t look like it’s a stage prop hanging from a mobile, it should be rising up one thermal and swooping
to catch the next.

All this is more work, but it’s what Unity does well that Maya doesn’t. If the point of the class is creating interactive environments; the behavior of every entity you put in that environment is very important: do they even have behavior, or is it essentially just a short film that you can walk through?