Join Adam Crespi for an in-depth discussion in this video Setting pivot points, part of Animating for Unity 3D in 3ds Max.
For animated objects, we need to set the pivot here in 3ds Max. We can move a pivot temporarily when snapping an object together to another object in Unity, but we need to set the pivots for animation here. We have a choice in Unity really of pivot or global, but not where it goes necessarily. I'll set the pivot for the door so it swings on well, what should be the hinges. I'll click on the door and click on then the Hierarchy tab. I'm in the pivot section and I'll click on the affect pivot only button.
There's the door's pivot and I'll move it into top view. I'll press t for top and F3 for a wire frame so I can see what I'm doing a little better. Pressing z zooms on the extents and g can turn off the grid temporarily. Now, press w for move and I'm going to snap this pivot into place. Notice that I've configured my snaps to use 2.5D snap. And in the snaps, either right-clicking on the Snap button or holding Shift and right-clicking, I've got the snap set to Vertices and Enable Axis Constraints in Snaps.
This way I can move on one axis at a time if I need. And this pivot will stay where it is in the z plane and move only in the x and y in this view. I'll start out by grabbing the pivot on the x, y plane. And snapping it, right on the corner of the door. Then I'll pull it up, just a little bit. In this case, pressing s to turn off snap. And move it forward on the y. We can move it where we'd like. And we may even want to move the door here, as well. I'll pull up the pivot just a touch.
And then turn off Affect Pivot Only, now I will grab the door and just nudge it back to the edge of the frame. As you can see here the door handle is not linked so I will press Ctrl+Z to undo that movement, hold Ctrl and select the door handle and pull both of them up. Right now, by default it's set to the view transform and using the selection center. That's okay for pivoting, because I haven't set the door handle, and I'm going to, set it separately. I've already set the door pivot, and it's still there where I put it. Now look at the handle.
For the handle I'll select it. Choose Affect Pivot Only and center to object. This way it rotates around its exact center. So when it spins we'll see that egg shape turning. I'll turn off Affect Pivot Only, and then look at the pivot of the door frame. It's down at the base and actually at the back of the door, because I've created this as a line. It's really fine where it is, although if we needed to rotate this object we could put this in somewhere maybe more convenient. It's really up to us on what we need to do with this and so the door frame, being a static object, can have its pivot wherever we like, what I'll do is put it over on a corner, I will click Affect Pivot Only and snap this pivot right onto the corner here, getting it close, pressing s to turn on the snaps and snapping on the corner of the door frame.
Hold Alt, click the mouse wheel in and spin into an orthographic view. We can see the pivot is actually midway up. I'll switch over to a 3D snap. And click and drag down on the y axis to snap this pivot right down to the base of the door frame. I will check were the door's pivot is as well, right now its down at the base and that's fine because its only going to rotate on the z axis. The door knob's pivot is in the center and it will spin on its local z.
But, really as long as it turns, I don't care what axis it is. I'll turn off Affect Pivot Only and I'm ready to export this out.
- Setting pivot points
- Using standard naming conventions
- Setting the root node
- Position object for export
- Exporting the animation
- Testing the animation in Unity
- Setting states and transitions in Mecanim