Legacy Documentation: Version 5.3
Scenes
GameObject

GameObjects

The GameObject is the most important type of object in Unity. It is very important to understand what a GameObject is, and how it can be used.

What are GameObjects?

Every object in your game is a GameObject. However, GameObjects don’t do anything on their own. They need special properties before they can become a character, an environment, or a special effect. But each of these objects do very different things. If every object is a GameObject, how do we differentiate an interactive power-up object from a static room? What makes these GameObjects different from each other?

Four different Game Objects, an animated character, a light, a tree and an audio source
Four different Game Objects, an animated character, a light, a tree and an audio source

The answer to this question is that GameObjects are containers. They can hold the different pieces that are required to make up a character, a light, a tree, a sound, or whatever else you would like to build. So to really understand GameObjects, you have to understand these pieces which are called Components.

Depending on what kind of object you want to create, you will add different combinations of Components to the GameObject. Think of a GameObject as an empty cooking pot, and Components as different ingredients that make up your recipe of gameplay. Unity has lots of different built-in component types, and you can also make your own Components using Scripts.

This section explains how Game Objects, Components and Scripts fit together, and how to create and use them.

Scenes
GameObject
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961