文字に動きを付けたく、テキストオブジェクトにアニメーターで動きをつけて
OnAnimationFinisn()のスクリプトをつけて形になったのでプレハブ化しました。
そのプレハブをボタンオブジェクトから動かしたいのですがエラーが出ます。
ボタンを一回押すといくつかの実行を経てから上記アニメーションを出したいのですがうまく行きません。
音楽再生→コルーチンにて数秒待機→アニメーション開始と行きたいのですが、数秒待機ののちアニメーション開始直前にエラーが出ます。
animator.Play()の使い方がダメなのでしょうか?
ボタンオブジェクト中のスクリプトでpublicGameObjectにてプレハブを代入はしています。
MissingComponentException: There is no 'Animator' attached to the "Button" game object, but a script is trying to access it.
You probably need to add a Animator to the game object "Button". Or your script needs to check if the component is attached before using it.
UnityEngine.Animator.Play (System.String stateName, Int32 layer, Single normalizedTime)
UnityEngine.Animator.Play (System.String stateName, Int32 layer)
texttest+<corcor>c__Iterator2.MoveNext () (at Assets/texttest.cs:123)
翻訳にかけるとボタンオブジェクトにアニメーターオブジェクトを入れましょう的なことが出てきますが、
入れたら入れたでボタンごと動いてしまい、その後エラーです。
どなたか解決策や、animator.Play()の正しい使い方、その他の良い方法など
分かる方はいますでしょうか?
宜しくお願いします
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/06/07 18:58