Using GetComponent is fairly simple, but its method signature is slightly different from other methods that we've seen so far:
GameObject.GetComponent<ComponentType>();
All we need is the component type that we're looking for, and the GameObject class will return the component if it exists and null if it doesn't. There are other variations of the GetComponent method, but this one is the simplest because we don't need to know specifics about the GameObject class that we're looking for. This is called a generic method, which we'll discuss further in Chapter 11, Exploring Generics, Delegates, and Beyond. However, for now, let's just work with the camera's transform.