This is a depreciated method for accessing a Rigidbody
component attached to your GameObject
.
You should either use:
GetComponent<Rigidbody> () = ... ;
any time you access the Rigidbody
or:
Rigidbody rb;
void Awake () {
rb = GetComponent<Rigidbody> ();
}
void FixedUpdate () {
rb.velocity = ... ;
}
And then you can use rb
as a reference to the attached Rigidbody
.