- Home /
Question by
Albertkaruna · Apr 12, 2015 at 09:21 AM ·
rigidbodyvariablerigidbody2dclass
Difference between Rigidbody2D and rigidbody2D
Every component in script has Rigidbody2D and rigidbody2D, Rigidbody and rigidbody, Animation and animation, Collider and collider,etc.
What is the difference between them(Uppercase and lowercase)?
Comment
Answer by tanoshimi · Apr 12, 2015 at 09:22 AM
Capital letters are the class. Lowercase letters are (pre-Unity 5) shortcuts to the instance of that class attached to the current object. i.e.
X.transform
is shorthand for
X.GetComponent<Transform>()
Answer by fafase · Apr 12, 2015 at 09:25 AM
Uppercase is the class, the type, while the lower case is the reference variable.
Transform transform;
is the reference to a Transform component and the reference is called transform.
They could have called it:
Transform robSchneider;
but then it is totally irrelevant.
Your answer
![](https://koobas.hobune.stream/wayback/20220613192844im_/https://answers.unity.com/themes/thub/images/avi.jpg)