naming conventions

Hi All - another noob question (sorry)
Im working with this code segment here:


if(!myCollision.gameObject.rigidbody){
myCollision.gameObject.AddComponent(Rigidbody);
}


Question on the Rigidbody:
Why when Im searching for it do I query “rigidbody”
and when I add it call it “Rigidbody”?
**capital vs lower case “r”

Is there a rule here?
thanks for any help.
J.

Rigidbody is a class type and the convention is that they are using a capital at the start. rigidbody is a special helper property, that your script can use to access a Rigidbody on the same GameObject.

Using rigidbody is 100% equivalent to calling gameObject.GetComponent(Rigidbody), which is the function normally used to get components (and which does use the class type, as you can see by the captial R). So, the only reason that rigidbody uses a lower case letter is because it’s not a class type but some property that is added to save you some typing.

Clear. - Thanks for the explanation.