< Return to Video

The Animation View - Unity Official Tutorials

  • 0:00 - 0:02
    The animation view allows you to create and
  • 0:02 - 0:06
    modify animation clips directly inside Unity.
  • 0:07 - 0:09
    It is designed to act as a powerful
  • 0:09 - 0:11
    and straightforward alternative to external
  • 0:11 - 0:13
    3D animation programmes.
  • 0:14 - 0:16
    For instance, if we wanted to have
  • 0:16 - 0:18
    a camera fly around a scene to give
  • 0:18 - 0:20
    a player an overview of a level
  • 0:20 - 0:23
    we can create that animation for it in Unity.
  • 0:25 - 0:27
    Here we have a scene with a camera
  • 0:27 - 0:28
    in the corner.
  • 0:29 - 0:31
    We would like to create an animation
  • 0:31 - 0:34
    for that camera which will allow it to move
  • 0:34 - 0:36
    from one side of the scene to the other.
  • 0:37 - 0:39
    Since we want to make an animation for the
  • 0:39 - 0:41
    camera we will want to ensure
  • 0:41 - 0:44
    that it is selected in the Hierarchy view.
  • 0:45 - 0:47
    We can then open the Animation view
  • 0:47 - 0:49
    by clicking Window - Animation.
  • 0:50 - 0:53
    Like any other view this is moveable
  • 0:53 - 0:55
    resizable and dockable.
  • 0:56 - 0:58
    There are many different buttons and options
  • 0:58 - 1:01
    visible when you first open the Animation view.
  • 1:01 - 1:05
    First and foremost is the animation drop-down.
  • 1:05 - 1:07
    Here is where we can select our different
  • 1:07 - 1:08
    animations to edit.
  • 1:09 - 1:11
    Since we don't currently have any animations
  • 1:11 - 1:13
    this drop-down is blank except for the
  • 1:13 - 1:16
    ability to create a new animation.
  • 1:18 - 1:20
    When you create a new animation you will
  • 1:20 - 1:22
    be prompted for a name and a location
  • 1:22 - 1:24
    to save the animation file.
  • 1:25 - 1:27
    We will create an animation called
  • 1:27 - 1:29
    CameraFlyThu and place it
  • 1:29 - 1:31
    in the Animations folder.
  • 1:32 - 1:34
    The Add Curve button allows us to choose
  • 1:34 - 1:36
    which components of our object,
  • 1:36 - 1:38
    or any child objects, we wish to modify
  • 1:38 - 1:40
    with our animation.
  • 1:41 - 1:43
    Each component can be expanded
  • 1:43 - 1:45
    to view more options.
  • 1:46 - 1:48
    To add a curve click the + sign next
  • 1:48 - 1:50
    to the item you wish to add.
  • 1:50 - 1:53
    Since we want our camera to fly around the scene
  • 1:53 - 1:57
    we will add the transform's position and rotation.
  • 1:58 - 2:00
    The timeline is where you will be able to
  • 2:00 - 2:03
    establish the timing of your animation.
  • 2:03 - 2:05
    The timeline is measured in frames and seconds.
  • 2:06 - 2:08
    The red scrubber allows you to choose what
  • 2:08 - 2:10
    frame you wish to modify.
  • 2:12 - 2:15
    Next is the Record and Play buttons.
  • 2:15 - 2:17
    When the record button is pressed
  • 2:17 - 2:19
    changes made to the chosen object
  • 2:19 - 2:21
    in the Scene view will be added automatically
  • 2:21 - 2:24
    to the animation at the currently selected frame.
  • 2:26 - 2:28
    The play button will allow you to preview
  • 2:28 - 2:29
    your animation.
  • 2:31 - 2:32
    The left and right arrows allow you to
  • 2:32 - 2:35
    navigate through the keyframes of the animation.
  • 2:36 - 2:38
    Next are the buttons which allow you to
  • 2:38 - 2:40
    add keyframes and events to the
  • 2:40 - 2:42
    currently selected frame.
  • 2:42 - 2:44
    The Sample property determines how many
  • 2:44 - 2:47
    frames make up one second of animation.
  • 2:47 - 2:51
    Reducing this number makes our animations slower.
  • 2:52 - 2:54
    At the bottom are two buttons that allow
  • 2:54 - 2:57
    you to transition between dope sheet mode,
  • 2:57 - 2:58
    which we are currently on,
  • 2:58 - 3:00
    and curve view mode.
  • 3:02 - 3:04
    With the record button pressed
  • 3:04 - 3:06
    it can be very easy to rough out the animation
  • 3:06 - 3:07
    that we want.
  • 3:08 - 3:10
    Simply select the frame we want to modify
  • 3:10 - 3:12
    and then set the desired camera position
  • 3:12 - 3:15
    and rotation in the scene view.
  • 3:15 - 3:18
    You will notice that a keyframe has been added
  • 3:18 - 3:20
    to the timeline with the appropriate values.
  • 3:21 - 3:23
    Properties that are currently being animated
  • 3:23 - 3:26
    are highlighted in red in the Inspector.
  • 3:27 - 3:30
    We can continue doing this for the various phases
  • 3:30 - 3:32
    of our fly through animation.
  • 3:33 - 3:35
    To preview the animation click the
  • 3:35 - 3:38
    play icon next to the record icon
  • 3:38 - 3:40
    in the animator view.
  • 3:42 - 3:44
    If we were satisfied with our animation
  • 3:44 - 3:46
    we could be done now.
  • 3:46 - 3:49
    If we wanted to fine tune our animation however
  • 3:49 - 3:52
    we would want to look at the curves mode.
  • 3:52 - 3:55
    To enter the curves mode select the Curves button
  • 3:55 - 3:58
    at the bottom of the animation view.
  • 3:59 - 4:01
    Here we can see the various curves of our
  • 4:01 - 4:03
    animation by selecting the corresponding
  • 4:03 - 4:06
    component on the left.
  • 4:06 - 4:09
    Again we can select a frame using the red
  • 4:09 - 4:11
    red scrubber on the timeline.
  • 4:14 - 4:16
    To modify a value on a curve
  • 4:16 - 4:18
    click and drag a keyframe to the new
  • 4:18 - 4:19
    desired value.
  • 4:19 - 4:22
    To create a new keyframe click the
  • 4:22 - 4:24
    Create Keyframe button,
  • 4:24 - 4:26
    or double click on the curve.
  • 4:27 - 4:29
    Right-clicking on a keyframe will pull up
  • 4:29 - 4:31
    some of it's options.
  • 4:31 - 4:33
    the most notable of these options is the ability
  • 4:33 - 4:35
    to choose Free Smooth.
  • 4:35 - 4:38
    This will create two handles are the keyframe
  • 4:38 - 4:40
    which you can use to smooth the curve
  • 4:40 - 4:42
    to your liking.
  • 4:43 - 4:45
    Another way to control our curves is to
  • 4:45 - 4:47
    choose the Broken option.
  • 4:48 - 4:50
    This allows you to control each side of the
  • 4:50 - 4:52
    keyframe indecently.
  • 4:53 - 4:55
    In this example we will want to add
  • 4:55 - 4:57
    a little variance to the exposition
  • 4:57 - 4:59
    of the transform.
  • 4:59 - 5:01
    Doing so will give us more of a weightless feel
  • 5:01 - 5:03
    to our animation.
  • 5:04 - 5:07
    Again we can do so by creating keyframes
  • 5:07 - 5:09
    on the exposition curve and changing
  • 5:09 - 5:11
    our values manually.
  • 5:13 - 5:16
    The animations created in Unity have the same
  • 5:16 - 5:19
    Inspector settings as animations made
  • 5:19 - 5:20
    in external programmes.
  • 5:21 - 5:22
    We can see these by selecting our clip
  • 5:22 - 5:25
    in the Project view.
  • 5:25 - 5:26
    Since we want our camera to fly across the
  • 5:26 - 5:29
    screen only once, we best uncheck
  • 5:29 - 5:31
    are Loop Time property.
  • 5:32 - 5:35
    It is interesting to note that an animator
  • 5:35 - 5:37
    is in charge of animation playback for generic
  • 5:37 - 5:39
    objects the same as it is for humanoids.
  • 5:40 - 5:42
    Unity has automatically added the
  • 5:42 - 5:45
    animator to our camera and created an
  • 5:45 - 5:47
    animator controller, a state machine
  • 5:47 - 5:49
    and added it to this component
  • 5:50 - 5:52
    The clip we just created is added to the
  • 5:52 - 5:54
    state machine as the default clip
  • 5:54 - 5:56
    that would be played at runtime.
  • 5:58 - 6:00
    This means we can go on to record
  • 6:00 - 6:02
    other clips and use the animator
  • 6:02 - 6:04
    to decide when to play them.
  • 6:04 - 6:06
    In this manner, once our animation clip
  • 6:06 - 6:09
    is completed we can run our scene
  • 6:09 - 6:11
    to see it in action.
Title:
The Animation View - Unity Official Tutorials
Description:

more » « less
Video Language:
English
Duration:
06:21

English subtitles

Revisions