facebook twitter hatena line email

Unity/3d/アニメーション

提供: 初心者エンジニアの簡易メモ
2020年6月6日 (土) 04:41時点におけるAdmin (トーク | 投稿記録)による版 (人型アセットのDL)

移動: 案内検索

人型アセットのDL

  1. AssetStoreからZonbie(https://assetstore.unity.com/packages/3d/characters/humanoids/zombie-30232?locale=ja-JP)をダウンロード
  2. それをimport
  3. PrefubからZonbie1をヒエラルキーにドラッグ
  4. Assetsの下にAnimetionsのdirを作成しCreate/AnimatorControllerを作成
  5. 例として、ZonbieAnimatorControllerとして作成
  6. Zonbie1のanimetorにPrefubのAnimattionsのZonbie~を全てZonbieAnimatorController上へドラッグして入れる
  7. defaultをZ_Idolを設定
  8. parameterにfloatのSpeedを設定する
  9. Z_IdolでMakeTransitionからZ_WalkへSpeed>0.1で設定する
  10. zonbieオブジェクトに以下csをアタッチする

ZonbieController.cs

using UnityEngine.AI;
[RequireComponent(typeof(Animator))]
public class EnemyController : MonoBehaviour
{
    Animator animator;
    void Start()
    {
        animator = GetComponent<Animator>();
    }
    void Update()
    {
        animator.SetFloat("Speed", 0.2f, 0.1f, Time.deltaTime);
    }
}


参考:https://unity.moon-bear.com/zombie-slayer/enemy-animation/