【3Dゲームエンジン】Unity質問スレッド24 [無断転載禁止]©5ch.net
■ このスレッドは過去ログ倉庫に格納されています
0442名前は開発中のものです。
2016/05/17(火) 13:53:54.12ID:qMLet7/6こちらのサイトを見ながらブロック崩しを作成しているのですが
「BallScriptを作成して記述」の所をそのまんま記入したところ、コンパイルエラーが発生してしまいます。
エラーの内容は以下の通りです。
Assets/BallScript.js(9,42): BCE0144: 'UnityEngine.Component.rigidbody' is obsolete. Property rigidbody has been deprecated. Use
GetComponent<Rigidbody>() instead. (UnityUpgradable)
Assets/BallScript.js(9,52): BCE0019: 'velocity' is not a member of 'UnityEngine.Component'.
Assets/BallScript.js(10,9): BCE0144: 'UnityEngine.Component.rigidbody' is obsolete. Property rigidbody has been deprecated. Use
GetComponent<Rigidbody>() instead. (UnityUpgradable)
Assets/BallScript.js(10,19): BCE0019: 'AddForce' is not a member of 'UnityEngine.Component'.
ちなみに自分が入力したソースコードは以下の通りです。
#pragma strict
var Speed : float = 15.0;
function Start () {
}
function Update () {
if (Input.GetButtonUp("Jump") && rigidbody.velocity == Vector3(0, 0, 0)){
rigidbody.AddForce((transform.forward + transform.right) * Speed, ForceMode.VelocityChange);
}
}
エラーコード番号や英文をググったりしましたがわかりませんでした。どなたか教えていただけないでしょうか。
■ このスレッドは過去ログ倉庫に格納されています