こちらのサイトを見ながらブロック崩しを作成しているのですが 「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); }