Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Animation takes time and patience to finesse and get right. Once we've got an animation on an object, we can adjust its timing in the Animation Editor. For example, we'll take this door, French door 20 and smoothly open it. Right now it kind of jerks as it opens. When I pick that door, I can see there's an animation already on it, French_door20Swing. It's unchecked to play automatically, and I can also set the loop type depending on how I want to trigger it. For these animations, if we look in the Animations section where we put that animation and select the actual animation, there's a loop time in there.
I'm going to leave that checked, because I want it to play once when I trigger it. It's not set to play automatically. And so the difference in here is really, is it playing automatically and looping? Is it playing automatically and not looping? Is it not looping and not playing automatically? And hence triggered by something else. Now I'll edit that animation. I'll select it and choose Window and Animation. This is a legacy mode here in Unity. Most of the task of taking on animations and setting up behaviors have been taken over by Mecanim, but this is still useful for simple work.
There's the rotation, and I'll go into the Curves menu in the animation window. Open up rotation, and select my Y rotation. There's no rotation on X and Z, but as part of creating key frames for rotation, I got them there. I'll leave them alone, as they're not affecting anything, and go back to the Y rotation. The curve into 130 looks pretty good. It's a nice, smooth open on the door. However, back here at zero, the door kind of jerks into motion. It's basically a linear tangent there, and I'd like it to smooth out a bit.
I'll pick that key and right-click on it, and I've got some options available. I can tell it to be free smooth, flat, broken, where the left and right tangents are independent. Or I can go into both tangents and choose how they operate. What I'll do is set this out as a flat or free smooth to start. And now I've got a baize handle available. This handle or tangent will let me manipulate this curve. It's already smoother because it's a slow end to that motion. I'll pull that handle down a little bit, and just smooth out that motion, starting it a little bit slower even.
If you're familiar with working in Maya, these tangents are locked. That means we can't extend them out. For those of you familiar with 3ds Max, you'll find that you expect the tangent handle to move freely and affect the weight, but in fact they're locked, and simply affect direction. This is an important distinction to make here, in that if we can't get an animation good enough here, we should do it in another application and bring it in. However, for most things, this kind of subtlety we have available will work nicely, and so I've got a smooth animation into that door.
Just keep that in mind. That there are programs that are built for animating, and if you're finding you're not getting the right results here in Unity, you can always bring in that animation. Now, go look at the end. Scrolling back and going into that frame at six. I'll select it, right click, and choose Flat again. And that's going to flatten out that tangent, smoothing out that motion. Lastly, we can choose how our keys are behaving. If we're finding we'd like to work in step tangents or constant. To be able to block out an animation, we can do that.
For example, I'll pick this key here at 430 and right click, and I'll put the right tangent to constant. Now it holds that value and then drops into that motion. This is useful for blocking out an animation. Or if we need something to change over one frame quickly, I'll return that tangent back. Choosing Right Tangent and Linear and then flattening it out again. Now I've got some smooth motion in there and my door will open, come to a nice stop and hold, and then close.
Get unlimited access to all courses for just $25/month.Become a member
100 Video lessons · 8533 Viewers
107 Video lessons · 37408 Viewers
94 Video lessons · 26719 Viewers
147 Video lessons · 6171 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.