- Home /
Question by
EliteFrame · Oct 14, 2016 at 05:54 AM ·
camerascript.
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
Comment
Best Answer
Answer by OpenXcell-Studio · Oct 14, 2016 at 06:48 AM
Rigidbody rigidbody = gameObject.GetComponent<Rigidbody> ();
if (rigidbody != null)
{
rigidbody.freezeRotation = true;
}
use this it will works in unity 5.3