< Return to Video

Avatar Masks - Unity Official Tutorials

  • 0:00 - 0:03
    Sometimes when animating an avatar
  • 0:03 - 0:05
    we want to isolate areas of the body
  • 0:05 - 0:07
    that are actually effected by the animation.
  • 0:08 - 0:11
    For example we might have a wave animation
  • 0:11 - 0:13
    but we want to be able to wave while running,
  • 0:13 - 0:15
    walking, jumping, etcetera.
  • 0:16 - 0:18
    In order to achieve this effect
  • 0:18 - 0:20
    we can use an avatar mask.
  • 0:20 - 0:22
    In this way we can restrict the effect
  • 0:22 - 0:24
    of this animation to be purely based
  • 0:24 - 0:26
    on the arm of the avatar.
  • 0:28 - 0:30
    Avatar masks can be created and used
  • 0:30 - 0:33
    in 2 distinct ways, but the overall effect
  • 0:33 - 0:35
    of the mask is the same.
  • 0:36 - 0:38
    Avatar masks can first be created on a
  • 0:38 - 0:40
    per-animation basis.
  • 0:40 - 0:43
    For this method go to the Animations tab
  • 0:43 - 0:45
    of the Model Importer by selecting a model
  • 0:45 - 0:47
    in the Project Panel and clicking on the
  • 0:47 - 0:49
    Animations tab.
  • 0:50 - 0:52
    When you select an animations clip
  • 0:52 - 0:54
    there are a number of properties that appear
  • 0:54 - 0:55
    below the clip name.
  • 0:55 - 0:58
    One of these is a drop-down called Mask.
  • 0:59 - 1:01
    Here you can create a mask that is unique
  • 1:01 - 1:04
    to the specific animation you are editing.
  • 1:05 - 1:07
    The other method for creating an avatar mask
  • 1:07 - 1:10
    is to create it as an asset in your Project Panel
  • 1:10 - 1:14
    by right-clicking and selecting Create - Avatar Mask.
  • 1:15 - 1:18
    Once it is created it can then be applied
  • 1:18 - 1:20
    to the layers of an animator controller
  • 1:20 - 1:22
    using the Animator window.
  • 1:22 - 1:25
    Creating and applying a mask this way will
  • 1:25 - 1:28
    effect all animations on an animator layer.
  • 1:29 - 1:32
    For more information on animator layers
  • 1:32 - 1:34
    see the lesson linked below.
  • 1:35 - 1:37
    An avatar mask has 2 parts,
  • 1:37 - 1:39
    Humanoid and Transform.
  • 1:41 - 1:43
    The Humanoid drop-down has a diagram
  • 1:43 - 1:45
    of a humanoid facing you from the screen.
  • 1:46 - 1:48
    This means that the diagram's left hand
  • 1:48 - 1:50
    is on the right side.
  • 1:51 - 1:53
    By clicking on each section you can toggle
  • 1:53 - 1:55
    it's colour between red and green.
  • 1:56 - 1:58
    You can also click outside the diagram
  • 1:58 - 2:01
    to toggle between all red and all green.
  • 2:02 - 2:04
    The colour indicates which parts of a humanoid
  • 2:04 - 2:07
    avatar will be animated when using this mask.
  • 2:08 - 2:11
    Green indicates that the body part will be used
  • 2:11 - 2:13
    and red indicates that it will not be used.
  • 2:14 - 2:17
    For our wave animation we have all but the
  • 2:17 - 2:19
    right arm deselected.
  • 2:19 - 2:20
    This means that only the right arm
  • 2:20 - 2:22
    will be effected by the animation.
  • 2:24 - 2:27
    The second part is the Transform Mask.
  • 2:27 - 2:30
    Transform masks are used for generically
  • 2:30 - 2:32
    rigged models and humanoid rigged models
  • 2:32 - 2:34
    with extra bones.
  • 2:34 - 2:37
    For example, if you had a 4 legged robot
  • 2:37 - 2:39
    or a humanoid with wings.
  • 2:40 - 2:42
    Here you need to select the avatar
  • 2:42 - 2:44
    to base the mask on.
  • 2:44 - 2:48
    This is done using the circle select button.
  • 2:50 - 2:52
    When an avatar has been selected
  • 2:52 - 2:55
    and imported a full list of all of the transforms
  • 2:55 - 2:57
    for that avatar appear.
  • 2:57 - 3:00
    From this you can select or deselect
  • 3:00 - 3:02
    which transforms should be effected
  • 3:02 - 3:03
    by the animation.
  • 3:03 - 3:05
    If a transform is checked then it will be
  • 3:05 - 3:09
    part of the mask and will move when animated.
  • 3:09 - 3:11
    For example, imagine we have a
  • 3:11 - 3:13
    humanoid avatar with a tail.
  • 3:14 - 3:16
    In the base layer of the animator state machine
  • 3:16 - 3:19
    the character has it's locomotion managed.
  • 3:19 - 3:22
    On subsequent layers other animations
  • 3:22 - 3:24
    such as attacking are handled.
  • 3:25 - 3:27
    It might be a good idea for these subsequent
  • 3:27 - 3:29
    layers to have a transform mask where
  • 3:29 - 3:31
    the tail bones are unchecked.
  • 3:32 - 3:34
    This means that the tail is not effected
  • 3:34 - 3:36
    by animations on those layers
  • 3:36 - 3:38
    and will still be moved by animations playing
  • 3:38 - 3:40
    on the base layer.
Title:
Avatar Masks - Unity Official Tutorials
Description:

more » « less
Video Language:
English
Duration:
03:42

English subtitles

Revisions