← SEARCHABLE ARCHIVE
Unity · 2026-07-05

How does Unity structure a game?

Understanding GameObjects, components, and the lifecycle

INTERACTIVE READING MODE →

The articles written on this blog were created with the goal of teaching. Also, the information in the article may be incorrect, so please be careful.

Unity is an engine that configures games by attaching necessary functions to game objects as components. It is closer to combining small functions rather than deepening the inheritance structure.

GameObject is more like an empty vessel

Most of the characters, cameras, and lights visible in the scene are GameObjects. However, the GameObject alone does not appear or move on the screen.

Player GameObject
├─ Transform
├─ SpriteRenderer
├─ Rigidbody2D
└─ PlayerController

Transform holds position, rotation, and scale. SpriteRenderer draws an image, while Rigidbody2D participates in physics calculations. A C# script created by a developer also becomes a component.

Life cycle of MonoBehaviour

Unity calls MonoBehaviour functions at specific points in an object's lifecycle.

using UnityEngine;

public class PlayerMover : MonoBehaviour
{
    [SerializeField] private float speed = 5f;

    private void Start()
    {
        Debug.Log("Player is ready");
    }

    private void Update()
    {
        float x = Input.GetAxisRaw("Horizontal");
        transform.position += Vector3.right * x * speed * Time.deltaTime;
    }
}

Awake is often used to prepare the object's initial state, while Start is useful for connecting it to other objects before the first frame. Update is called every frame, so it is suitable for handling input and general updates.

If you apply physical forces, consider FixedUpdate, which is called at fixed intervals. Before putting all code in Update, check whether it truly needs to run every frame.

Scenes and Prefabs

A scene is a set of objects currently placed on the screen. Prefab is a GameObject configuration to be reused saved as an asset.

Prefabs can be duplicated without resetting the component each time the same enemy is placed multiple times. Modified content can also be reflected in multiple instances based on the Prefab.

When starting Unity, it is a good idea to create only the player, floor, and goal point in one scene and then complete the flow from input to collision. It is more important to distinguish what responsibilities each Component has than what a GameObject is.