Input Debug questions

Hi all,

It is said that:
“Transform” is a class. We use it to create instance “transform”

transform.position.x = 10;

“Renderer” is another class. We use it to create instance “renderer”

renderer.enabled = true;

Then,…
“Input” is a class. Why we write “Input” in coding, not “input”?

Input.mousePosition.x

Similarly,
“Debug” is a class. Why we write “Debug” in coding, not “debug”?

Debug.Log("Hello");

Are “Input” and “Debug” are exceptions to the rule above?

Thanks in advance

A class can basically be two things, a blueprint for objects and a collection of utility methods and stuff (the static things).

The Transform class is used to create object instances of type Transform. The variable (or property) named “transform” points to such an object. It’s lower case because that’s the convention used for variable names. The same goes for “renderer”, which is a variable of the Renderer type.

The Input class isn’t used to generate objects, instead it has a collection of static utility methods and properties. You simply call those directly from the class. Hence, you write Input.mousePosition and such. The same goes for Debug.

Thanks a lot, Jasper Flick.
:slight_smile: