public Component GetComponent (Type type)
>ゲームオブジェクトに type がアタッチされている場合は type のタイプを使用してコンポーネントを返します。ない場合は null です
c# // Assigns the player ball's rigidbody instance to the variable rb = GetComponent<Rigidbody>();