---
title: 정렬 레이어에서 2D GameObjects 혼합 방지
product: Unity Editor
version: '6000.0'
latest_version: '7000.0'
status: This page documents version 6000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/ko-kr/engine/6000.0/manual/unity2d/sprite/sort-sprites/use-sorting-groups
latest_url: https://docs.unity.com/ko-kr/engine/7000.0/manual/unity2d/sprite/sort-sprites/use-sorting-groups.md
last_updated: 2026-10-30
generated_at: 2026-11-20T09:04:50.419Z
locale: ko-kr
---

# 정렬 레이어에서 2D GameObjects 혼합 방지

> 동일한 정렬 레이어와 하위 레이어에서 2D GameObjects 그룹이 함께 혼합되지 않도록 합니다.

2D GameObjects 그룹이 동일한 정렬 레이어와 하위 레이어에 있는 다른 오브젝트 그룹과 혼합되지 않도록 하려면 GameObjects 정렬 그룹에 추가합니다.

예를 들어 이 접근법을 사용하면 동일한 정렬 레이어와 하위 레이어를 사용하더라도 동일한 프리맵의 다중 인스턴스 서로 혼합되지 않도록 방지할 수 있습니다.

다음 단계를 따르십시오.

1. **Hierarchy** 창에서 2D GameObjects 그룹을 생성하고 해당 **Sorting Layer** 및 **Order in Layer** 값을 설정하여 정렬합니다.
2. 그룹의 계층 구조 상단에 있는 게임 오브젝트를 선택합니다.
3. Editor 창에서 **Add Component** > **Rendering** > **Sorting Group**을 선택합니다.
4. **Sorting Group** 컴포넌트에서 **Sorting Layer** 및 **Order in Layer** 값을 설정합니다.

정렬 순서는 동일하지만, 이제 모든 자식 GameObjects Sorting Group 컴포넌트의 정렬 레이어와 SubLayer 레이어에서 렌더링됩니다.

> **Note:**
>
> Unity 각 자식 게임 오브젝트의 **Distance to Camera** 프로퍼티를 무시합니다. Unity Sorting Group 컴포넌트가 있는 게임 오브젝트의 포지션을 기반으로 거리를 계산합니다.

## 중첩 정렬 그룹##nest-sorting-groups

정렬 그룹을 중첩할 수 있습니다. 중첩된 정렬 그룹은 먼저 정렬된 다음 부모 정렬 그룹 내에서 단일 항목으로 정렬됩니다.


**A nested sorting group, its parent sorting group, and a third sorting group.:**
![](/api/media?file=/engine/6000.0/media/images/SG_diagram2.png)

**계층 구조** 창에서 그룹을 이동하지 않고 계층 구조의 최상위 수준으로 중첩된 정렬 그룹을 이동하려면 정렬 그룹을 선택한 다음 **정렬 타입**을 **루트에서 정렬**으로 설정합니다.

## 예제##example

다음 예제에서 스프라이트는 동일한 **정렬 레이어**에 속하지만, 다른 **레이어 순서** 값을 가집니다. 계층 구조에서 프립을 생성할 때 여러 프립 인스턴스의 스프라이트는 동일한 레이어에 있으며 서로 혼합될 수 있습니다.


**A prefab of a zombie character. The hierarchy represents the different Order in Layer values of the different body parts. For example, the arms are rendered in front of the body. The character looks correct.:**
![](/api/media?file=/engine/6000.0/media/images/character_hierarchy.png)


**Two instances of the prefab without a sorting group. The sprites render incorrectly, because the body parts are all on the same sublayers.:**
![](/api/media?file=/engine/6000.0/media/images/part_intersect.png)

정렬 그룹을 추가하는 경우, 프립 인스턴스가 올바르게 렌더링됩니다.


**Five instances of the prefab with a sorting group. The sprites render correctly.:**
![](/api/media?file=/engine/6000.0/media/images/unique_orderlayer.png)

믹싱이 계속 발생하면 각 정렬 그룹에 대해 다른 값으로 **Layer 순서** 값을 설정합니다.

## 추가 리소스##additional-resources

* [2D 렌더링 순서](/engine/6000.0/manual/unity2d/sprite/sort-sprites/sort-sprites.md)
