rigidbody.velocity not recognized

I am coding in Unity 5.0 using a tutorial from an older version. When writing the script rigidbody.velocity = movement; (movement is Vector3D), rigidbody is not recognized. I have tried Rigidbody.velocity but velocity is not recognized. Suggestions?

That way to access was deprecated as you’ve already noticed, now you need to use GetComponent, e.g.:

// C#
GetComponent<Rigidbody>().velocity = movement;

Obviously you’ll need to have Rigidbody component on your gameobject.

Also if you’ll use that line of code more than once in your code (which seems like you will) I’d recommend to store the reference to rigidbody instead. If you don’t know how to do it then you can check my answer THERE for an example.

Try:
gameObject.GetComponent<Rigidbody>().velocity (for C#) or gameObject.GetComponent(Rigidbody).velocity (for UnityScript / javascript).