Version: 2023.1
言語: 日本語
Animator コンポーネント
AnimatorController の作成

アニメーターコントローラー

アニメーターコントローラーを利用すると、キャラクターやオブジェクトのアニメーションクリップや関連するアニメーション遷移のセットを配置し管理できます。たいていの場合、複数のアニメーションを利用して、ゲーム内で特定の状況が起きたときにそれらを相互に切り替えて使用するのは普通のことです。例えば、スペースバーが押される度に歩きのアニメーションからジャンプのアニメーションへ切り替える、などです。ただし、単一のアニメーションクリップしかない場合でも、それをゲームオブジェクトに使用するためには、アニメーターコントローラーに配置する必要があります。

The Animator Controller has references to the Animation clips used within it, and manages the various Animation Clips and the Transitions between them using a State Machine, which could be thought of as a flow-chart of Animation Clips and Transitions, or a simple program written in a visual programming language within Unity. More information about state machines can be found here.

シンプルなアニメーターコントローラー
シンプルなアニメーターコントローラー

Animation ウィンドウを使ってゲームオブジェクトをアニメーション化し始めるとき、または、アニメーションクリップをゲームオブジェクトにアタッチするとき、Unity は自動的にアニメーターコントローラーを作成します。

To manually create an Animator Controller, right-click within either column of the Project window and select Create > Animator Controller.

ナビゲーション

Use the scroll wheel to zoom in and zoom out of the Animator Controller window.

Animator Controller ウィンドウのアイテムにフォーカスを置くには、1 つまたは複数の状態を選択し (選択したいステートを囲む選択ボックスをクリックまたはドラッグ) して、F キーを押して選択したものをズームします。

選択した状態にフォーカスを置く
選択した状態にフォーカスを置く

アニメーションの状態すべてを Animator Controller ウィンドウにフィットさせるには A キーを押します。

Unity は選択したものを保ちます。A と F キーを押すと、選択したアニメーションの状態と Animator Controller 全体で切り替えすることができます。

A キーを押すと、Unity は自動的にすべての状態を Animator Controller ウィンドウにフィットさせます
A キーを押すと、Unity は自動的にすべての状態を Animator Controller ウィンドウにフィットさせます

再生モードでは、アニメーターがビューをパンして、再生中の現在の状態が常に表示されるようにします。 Animator Controller は、ベースレイヤーとサブステートマシンの独立したズームの要因に基づいて、ウィンドウが自動的にパンして、アクティブな状態を確実に表示します。

再生モード中のズームの変更は、以下の手順で行います。

  • Enable Auto Live Link in the Animator Controller window.
  • Click the Play button to enter Play Mode.
  • Click Pause.
  • In the Animator Controller, select the state or states you want to zoom into.
  • Press the F key to zoom into the selection.
  • Click the Play button again to resume Play Mode.

Animator Controller は各状態がアクティベートされるときに、パンして表示します。

Animator アクティブな状態をパンして表示
Animator アクティブな状態をパンして表示

AnimatorController

Animator コンポーネント
AnimatorController の作成