Version: 2019.4
GameObject
Использование компонентов

Introduction to components

A GameObject is an object in the Unity Editor which contains components. Components define the behaviour of that GameObject.

This page describes how to view and interact with components, and provdes a brief overview of the most common component configurations in Unity.

To view a GameObject’s components, select the GameObject in the Scene window or Hierarchy window, then see the Inspector window for a list of all components and their settings.

You can interact with components directly in the Editor, or through script. See the Scripting section for guidance on how to control and interact with components through script.

Common component configurations

This section details some fundamental default component configurations in Unity.

Transform component

The Inspector of a new, empty GameObject showing the Transform Component
The Inspector of a new, empty GameObject showing the Transform Component

Every GameObject in Unity has a Transform component. This component defines the GameObject’s position, rotation, and scale in the game world and Scene view. You cannot remove this component.

The Transform component also enables the concept of parenting, which allows you to make a GameObject a child of another GameObject and control its position via the parent’s Transform component. This is a fundamental part of working with GameObjects in Unity.

Main Camera GameObject components

The Main Camera GameObject
The Main Camera GameObject

By default, every new Scene starts with a GameObject called Main Camera. This GameObject is confugured to act as the primary camera in your game. It contains the Transform component, the Camera component, and an Audio Listener to pick up audio in your application.

GameObject
Использование компонентов