MissingComponentException: There is no 'RectTransform'の解決?(DOTween proを使っていて)

やっとDOTWeenを使う人に参入できそうです!!

が,ここでエラー?が・・・

There is no 'RectTransform' attached to the "ball" game object, but a script is trying to access it.

You probably need to add a RectTransform to the game object "ball". Or your script needs to check if the component is attached before using it.
UnityEngine.Debug:LogWarning(Object)

」って出てきました

 

他の人こうやってやってるじゃん!

ここでしっかり自分のものをみてみると,

f:id:ka1357amnbpdr:20190503215944p:plain

GameObjectがtransformだったのです!!

この時は,transformを入れないといけないのですね!!

void ball(){
RectTransform trans = GetComponent<RectTransform>();
// rect.DOMove (
// Vector3.one,  //移動後の座標
// 1.0f       //時間
// );
trans.DOScale(
new Vector3(0.9f,0.9f,0f),
0.9f
);
}

こんな感じなら動きました〜〜

 

 

freemさんにゲームを公開しました!

まだまだキャラクターを進めるだけになっていますが,これからどんどん機能・スキルなどを入れていきます.

よろしくお願いします ~~