実現したいこと
Unityでのアニメーションをスクリプト制御する際のWarningを解決したい
前提
Unity初心者です.
Unityでのアニメーションをスクリプト制御するコードを実行した際にWarningが出ました.制御自体はうまくいきましたがWarningの原因がよくわからないので教えていただきたいです.
animatorでstartというブロックからwaitというブロックに遷移する際の条件を指定しています.条件を満たすとtrueを出力しboolの真偽判定で遷移します.
発生している問題・エラーメッセージ
Invalid Layer Index '1' UnityEngine.StackTraceUtility:ExtractStackTrace ()
Parameter 'Next' does not exist.
Parameter 'Back' does not exist. UnityEngine.Animator:GetBool (string)
該当のソースコード
using System.Collections; using System.Collections.Generic; using UnityEngine; public class RunAndStop : MonoBehaviour { private Animator animator; void Start() { animator = GetComponent<Animator>(); } void Update() { for(int i = 0; i < 10000000; i++){ if(i == 999999){ animator.SetBool("wait", true); } } } }
試したこと
遷移条件変更やeditorの変更等を試しましたが消えず,根本的な問題があるように感じます.お力をお借りできると幸いです.
0 コメント