unity 6000.0.50f1 プロジェクト名: Humanoid Asset Store -> "Starter" で検索。 Starter Assets - ThirdPerson を"Unityで開く" package manager からproject に importする。 Open Scene Assets/StarterAssets/ThirdPersonController/Scenes/Playground.unity 新しいシーンを作る Scene01 Plane を hierarchy に置く。 新しいInput System は標準でインストールされている。 Edit --> Project Settings... --> Player --> Other Settings --> Configure --> Active Input Handling --> Both を確認する。 Assets/Models/ にMakeHuman のモデル群を Explorer (Finder) から直接ドラッグ&ドロップ AsianBoy を選んで、Rig から Humanoid -> Apply -> Configure -> Done AsianBoy を hierarchy に置く。 -> (add component) -> CharacterController -> Collider -> height 1.7 -> y 0.85 -> (add component) -> ActionInput PlayerMove.cs を作成。 (古い Input System を使っているがそのまま動く) (新しい Input System を使って動かしたい場合は、教科書の p.175 PlayerController.cs を使えばよい) AsianBoy -> (add component) -> Script -> PlayerMove 実行できる。 Scene01シーンを保存してから、新たにシーン Scene02 として保存。 PlayerMove2.cs を作成。 AsianBoy -->component から PlayerMove のチェックははずす AsianBoy --> (add component) -> Script --> PlayerMove2.cs 実行できる。 Project を保存して、Unity を終了。 Humanoid プロジェクトを複製して Humanoid2 プロジェクトを作る。 動作アニメーションファイルのありかは Assets/StarterAssets/ThirdPersonController/Character/Animations/ Jump--InAir.anim Jump--Jump.anim Locomotion--Run_N.anim Locomotion--Run_N_Land.anim Locomotion--Run_S.anim Locomotion--Walk_N.anim Locomotion--Walk_N_Land.anim Stand--Idle.anim Animator Controller を生成して、名前を AsianBoyAnimatorController に変更。 中に Idle と Walk 状態の遷移を作成。 AsianBoyの Animator コンポーネントの Controller に AsianBoyAnimatorController を設定する。 最後に動作させると、人の向きだけ変わって、アニメーションしないように見えるが、 4秒の変化時間が設定されているだけで、長く動作しているとアニメーションが開始される。 Animator ウインドウの transition で、"Has Exit Time" のチェックをはずすとすぐにアニメーションとなる。 「animation "Walk-N" の receiver の "OnFootstep" がない」という警告がでる。 これは、この名前の関数を定義してやればよい。本来は、足音を鳴らすなどのことをするための関数のようだ。