字幕表 動画を再生する
In order to animate the properties of
Unity でゲームオブジェクトのプロパティを
game objects in Unity we use the
アニメーションさせる際には Animator
Animator Component.
コンポーネントを使用します
Animator components have a number of properties
Animator コンポーネントはアニメーションを追加する
which may differ depending on what you are animating.
対象に応じたさまざまなプロパティを備えています
For example, a 3D humanoid character
これはたとえば 3D ヒューマノイドキャラクターと
will require different settings than a 2D sprite.
2D スプライトでは異なる設定が必要になるためです
Here we have a scene with a model in it.
さてここにモデルが 1 体配置配置されたシーンがあります
The model has an animator component attached.
モデルには Animator コンポーネントがアタッチされています
The first property of the animator component
Animator コンポーネントの最初のプロパティには
stores a reference to an animator controller asset.
アニメーターコントローラーアセットへの参照が格納されています
Animator controllers are Unity generated
アニメーターコントローラーは Unity が生成するアセットで
assets that contain one or more state machines
シーンの実行中にどのアニメーションを
which determine which animation is being played
再生するかを決定するステートマシンを
while the scene is running.
1 個以上含みます
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
Avatar は Unity が 3D ヒューマノイドを
when importing a 3D humanoid.
インポートする際に作成するアセットです
It contains a definition of the
Avatar にはキャラクターが持つ
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
Apply Root Motion(ルートモーションを適用)フィールドはアニメーションが
determines whether the animation can affect
ゲームオブジェクトの Transform に影響を
the transform of the game object
及ぼすかどうかを指定するもので
and is generally used with 3D humanoids.
通常は 3D ヒューマノイドに対して使用されます
Root Motion is the core movement
この Root Motion とは アニメーション
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
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
OnAnimatorMove 関数を呼び出し
and attaching it to your game object.
ゲームオブジェクトにアタッチします
See the documentation link below
この手順についての詳細は以下の
for more information on this.
ドキュメントのリンクを参照してください
Animate Physics can be either checked
Animate Physics(物理アニメーション)はオンでも
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
Rgidbody(剛体)を含む場合に
has a rigidbody.
オンにします
The Culling Mode of an animator effects
Culling Mode(カリングモード)は
whether or not the animations are being played
レンダリングされていない時にアニメーションを
while they're not being rendered.
再生するかどうかを指定するオプションです
Always Animate means that the
Always Animate(常にアニメーション)を指定すると
animations will play even while not
レンダリングされていない状態でも
being rendered.
アニメーションが再生されます
Based On Renderers means that the
Based On Renderers(レンダラーに合わせる)を指定すると
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
いずれのオプションを指定しても Root Motion は
is applied as it would normally.
通常と同じように適用されます
That is if a character was being made
このためキャラクターが Root Motion で歩くように
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