2Dの時計アプリを作っています。
アニメーションを使うのですが、アニメーションが起動しません。Playボタンを押したときになって、使いたい時に起動しないのです。
C#
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Animation : MonoBehaviour { Animation anim; void Start() { anim = this.GetComponent<Animation>(); } //別のスクリプトからの参照でアニメーション起動 public void Anim() { Debug.Log("OK!!"); anim.Play(); } }
Playボタンを押したらでるエラー
「The AnimationClip 'New Animation' used by the Animation component 'Button' must be marked as Legacy.
」
動いてほしい時に出るエラー
「Default clip could not be found in attached animations list.」
Play Automaticallyのチェックは外してあって、debug.logはうまくうごいてます。
このプログラムがついているオブジェクトには起動させたいアニメーションがちゃんとついています。
Unityは2019.1.11f1で
ビルドするOSはAndroid7.1.1です。
何か間違いがあったら言ってください。
まだ回答がついていません
会員登録して回答してみよう