GameObject
Reference Manual > Components > The GameObject > GameObject

GameObject

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


An empty GameObject

Details

GameObjects do not add any characteristics to the game themselves. Rather, they are containers that hold Components, which implement all actual functionality. For example, a Light is a Component which is attached to a GameObject. From scripts, Components can easily communicate with each other through message sending or the GetComponent(TypeName) method. This allows you to write small, reusable scripts that can be attached to multiple GameObjects and reused for different purposes.

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 Edit->Project Settings->Tags.

Hints