Removed

GameObject.rigidbody

Switch to Manual
Obsolete Property rigidbody has been deprecated. Use GetComponent<Rigidbody>() instead. public Component rigidbody;

Description

The Rigidbody attached to this GameObject (Read Only). (Null if there is none attached).

using UnityEngine;

public class Example : MonoBehaviour { void Start() { gameObject.GetComponent<Rigidbody>().AddForce(0, 0, 1); } }

Did you find this page useful? Please give it a rating: