GameObject
GameObjects are containers for all other Components. All objects in your game are inherently GameObjects.

An empty GameObject
Creating GameObjects
GameObjects do not add any characteristics to the game by themselves. Rather, they are containers that hold Components, which implement actual functionality. For example, a Light is a Component which is attached to a GameObject.
If you want to create a Component from script, you should create and empty GameObject and then add required Component using gameObject.AddComponent(ClassName) function. You can't create Component and then make a reference from object to it.
From scripts, Components can easily communicate with each other through message sending or the GetComponent(TypeName) function. This allows you to write small, reusable scripts that can be attached to multiple GameObjects and reused for different purposes.
Details
Aside from being a container for the components, GameObjects have a Tag, a Layer and a Name.
Tags are used to quickly find objects, utilizing the Tag name. Layers can be used to cast rays, render, or apply lighting to certain groups of objects only. Tags and Layers can be set with the Tag Manager, found in .
Hints
- For more information see the GameObject scripting reference page.
- More information about how to use layers can be found here.
- More information about how to use tags can be found here.
