Script incompatible with unity 5.3. Please Help!

I’m quite new to coding.
The problem lies between these lines

	if (rigidbody != null)
		rigidbody.freezeRotation = true;

Assets/Ultimate Orbit Camera/Scripts/UltimateOrbitCamera.cs(132,25): error CS0619: UnityEngine.Component.rigidbody' is obsolete: Property rigidbody has been deprecated. Use GetComponent() instead. (UnityUpgradable)’

I am not sure what to do other than change the properties to GetComponent but still get errors

Rigidbody rigidbody = gameObject.GetComponent ();

		if (rigidbody != null)

		{

			rigidbody.freezeRotation = true;
		}

use this it will works in unity 5.3