Placeholder Image

Subtitles section Play video

  • In order to animate the properties of

  • game objects in Unity we use the

  • Animator Component.

  • Animator components have a number of properties

  • which may differ depending on what you are animating.

  • For example, a 3D humanoid character

  • will require different settings than a 2D sprite.

  • Here we have a scene with a model in it.

  • The model has an animator component attached.

  • The first property of the animator component

  • stores a reference to an animator controller asset.

  • Animator controllers are Unity generated

  • assets that contain one or more state machines

  • which determine which animation is being played

  • while the scene is running.

  • These state machines can be on multiple layers

  • and use parameters of various types.

  • To affect when they transition between states

  • and blend.

  • For example

  • you can set the parameters of an

  • animator controller from your scripts to tell it

  • if the character is running, jumping

  • or shooting a gun.

  • It will then play and blend the animation

  • automatically.

  • The avatar is an asset that Unity creates

  • when importing a 3D humanoid.

  • It contains a definition of the

  • skeletal rig the character has.

  • When adding a character of this type to

  • your scene the avatar field will

  • automatically be filled in with an asset

  • created for that character.

  • Try to think of the avatar as the glue

  • that binds the model to be animated

  • to the animator.

  • For generic objects without skeletal

  • rigging an avatar is not required.

  • The Apply Root Motion field

  • determines whether the animation can affect

  • the transform of the game object

  • and is generally used with 3D humanoids.

  • Root Motion is the core movement

  • within an animation clip.

  • For example

  • imagine the difference between an animation

  • of a character running on the spot

  • verses one that is animated running a few

  • paces forward.

  • In the latter example

  • we can use the motion of the character moving

  • forward to drive the character

  • around in our game.

  • Looping that clip to give us realistic

  • continuous motion.

  • However, if you simply have

  • animations that run on the spot

  • you would uncheck Apply Root Motion

  • and instead move the character via script.

  • It is also possible to override this

  • property entirely.

  • This is done by creating a script with a

  • call to the onAnimatorMove function

  • and attaching it to your game object.

  • See the documentation link below

  • for more information on this.

  • Animate Physics can be either checked

  • or unchecked.

  • When it is checked it means that the

  • animations will be executed in time

  • with the physics engine.

  • Generally this is advised

  • if what ever you are animating

  • has a rigidbody.

  • The Culling Mode of an animator effects

  • whether or not the animations are being played

  • while they're not being rendered.

  • Always Animate means that the

  • animations will play even while not

  • being rendered.

  • Based On Renderers means that the

  • animation will only play while being rendered.

  • Meaning that when the character is

  • obscured from view animation will cease

  • to save performance.

  • With either option the root motion

  • is applied as it would normally.

  • That is if a character was being made

  • to walk with root motion applied

  • then they would continue to move even while

  • not being rendered so that the character

  • would end up in the correct place

  • when they became visible again.

  • Subtitles by the Amara.org community

In order to animate the properties of

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it