Legacy Documentation: Version 5.2
LanguageEnglish
  • C#
  • JS

Script language

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

Removed in version 5.2.1p2
Property rigidbody2D has been deprecated. Use GetComponent<Rigidbody2D>() instead. (UnityUpgradable)

Component.rigidbody2D

Switch to Manual
public Component rigidbody2D;

Description

The Rigidbody2D that is attached to the Component's GameObject.

This property will be null if no Rigidbody2D is attached.

See Also: rigidbody.