Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Removed in version 5.0.1p4
Property rigidbody has been deprecated. Use GetComponent<Rigidbody>() instead. (UnityUpgradable)

Component.rigidbody

Switch to Manual
public var rigidbody: Component;

Description

The Rigidbody attached to this GameObject (null if there is none attached).

	var rb = GetComponent.<Rigidbody>();
	rb.AddForce(1, 1, 1);