> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/extend-with-code/overview.md). Agents can also search and read this documentation through its [MCP server](https://docs.decentraland.org/~gitbook/mcp).

# 코드와 결합

Scene Editor에서 만든 콘텐츠와 코드 작성의 강력함을 결합합니다.

{% embed url="<https://www.youtube.com/watch?v=55H37rygD7M>" %}

Creator Hub와 사용자 지정 코드를 함께 사용하면 콘텐츠를 매우 강력하게 만들 수 있습니다. 캔버스에서 항목을 직관적으로 시각 배치한 다음, 이러한 항목과 자유롭게 상호작용하는 코드를 작성할 수 있습니다. 기본 동작이 내장된 스마트 항목을 배치하고, 항목이 활성화될 때 이에 반응하는 코드를 작성할 수도 있습니다.

예를 들어, 사운드와 애니메이션, 상태가 이미 포함된 레버 스마트 항목을 활용하고, 레버를 당겼을 때 이를 감지해 사용자 지정 로직을 실행하는 코드를 작성할 수 있습니다.

다음 문서를 참조하세요: [코드에서 항목 참조하기](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/extend-with-code/reference-items.md) 코드에서 이름이나 태그를 사용해 항목을 가져오는 방법을 알아보세요.

## 코드 편집

씬의 코드를 편집하려면 컴퓨터에 코드 편집기를 설치해야 합니다. 권장 옵션은 다음과 같습니다.

* <img src="https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-38ec445a6fa4d8c8b4e5f5c7b80ea1e58b35b6df%2Fvscode.webp?alt=media" alt="VS Code" data-size="line"> [Visual Studio Code](https://code.visualstudio.com/): 숙련된 개발자에게 권장하는 옵션입니다.
* <img src="https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-96c78b13a696e8a70912e19e76551a23ec486a5b%2Fcursor-icon.webp?alt=media" alt="Cursor" data-size="line"> [Cursor AI](https://www.cursor.com/): AI가 통합된 강력한 코드 편집기입니다. 코드를 작성하는 데 도움이 될 여러 AI 모델을 선택할 수 있습니다. 무료 요금제가 제공되며, 더 고급 모델을 사용하려면 유료 요금제가 필요합니다. Decentraland나 TypeScript를 처음 사용하는 개발자 또는 코드 작성 시간을 절약하고 싶은 개발자에게 적합한 옵션입니다.

{% hint style="warning" %}
**📔 참고**: macOS를 사용하는 경우 코드 편집기 앱이 Applications 디렉터리에 있는지 확인하세요.
{% endhint %}

설치 후 Creator Hub 설정에서 코드 편집기를 선택해야 할 수도 있습니다. 선택하려면 다음 단계를 따르세요.

1. 화면 왼쪽 상단의 Creator Hub 로고를 클릭하고 **설정**.
2. 을 선택합니다. **편집기** 탭을 엽니다.
3. 에서 **선호하는 코드 편집기**를 선택하고 코드 편집기를 지정합니다. 드롭다운 목록에서 편집기를 찾을 수 있습니다. 목록에 없다면 **기기에서 선택...** 을 선택해 찾아보세요.

![EDITOR 탭의 App Preferences 대화상자. Code editor of choice 드롭다운에서 Visual Studio Code가 선택된 모습입니다.](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-f029dfd5bb1c2065716584e240489cba215873d8%2Fsettings-editor.webp?alt=media)

## 씬 코드 열기

컴퓨터에 코드 편집기를 설치하고 Creator Hub 설정에서 선택한 후에는 **< > CODE** 버튼을 클릭해 씬 프로젝트에서 코드를 열 수 있습니다.

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-533a4b014b14355abfb053041727f76f80af1bf0%2Fcode-button.webp?alt=media)

코드 편집기가 별도의 창에서 열립니다. 왼쪽 여백에서 프로젝트의 파일 및 폴더 구조를 탐색할 수 있습니다.

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-8edff2d8b3628c0a40ddc86186b306e09d36923a%2Ffiles-on-vs-studio.webp?alt=media)

사용자 지정 코드는 `index.ts` 의 `/src`폴더 안에 있는 `main()` 함수에 추가하세요. 그 대신 해당 함수 바깥에 사용자 지정 코드를 추가하거나 새 `.ts` 파일을 `/src` 폴더 안에 만들 수도 있습니다. 다만 이러한 파일은 반드시 `main()` 의 함수 안에서 참조되어야 합니다. `index.ts`.

{% hint style="warning" %}
**📔 참고**: VS Code 또는 Cursor가 설치되어 있는데도 **CODE** 버튼을 클릭해도 열리지 않는다면, 명령줄에서 열리도록 VS Code가 컴퓨터에 올바르게 구성되지 않았을 수 있습니다. 대부분의 경우 기본 설치 과정에서 설정되지만, 그렇지 않은 경우에는 [VS Code 명령줄 사용 설정에 관한 이 안내](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line) 를 참조하세요.
{% endhint %}

씬이 실행 중인 미리보기 창을 열어 둔 상태에서 파일의 코드를 변경하고 저장하면, 변경 사항이 적용된 씬이 자동으로 다시 로드됩니다.

## AI 사용

Creator Hub에는 기본 제공 기능이 있습니다. [AI 어시스턴트](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/extend-with-code/ai-assistant.md) 열려 있는 씬을 확인하고 앱을 벗어나지 않아도 편집해 줍니다. 실험적 기능이며 기본적으로 꺼져 있습니다.

Cursor나 Claude Code 같은 AI 어시스턴트를 활용해 씬 코드를 작성할 수도 있습니다. 예를 들어 Cursor를 사용하려면 다음 단계를 따르세요.

1. 화면 오른쪽 상단의 **AI** 버튼을 클릭해 Cursor AI 어시스턴트를 여세요.
2. 여기에서 AI 어시스턴트에게 코드 작성을 도와 달라고 요청할 수 있습니다. 프롬프트에는 문서 페이지 링크, 프로젝트 내 특정 파일의 경로, 이미지까지 포함할 수 있습니다. 드롭다운에서 사용할 모델을 선택할 수도 있습니다.

AI 어시스턴트에 Decentraland 관련 맥락을 제공하려면 공식 Decentraland SDK Skills를 설치하세요. Decentraland Foundation에서 관리하는 이 사전 제작 지침 세트는 씬 전체 구성, 3D 모델 추가, 멀티플레이어, 배포 등 모든 주제에 대해 검증된 SDK7 패턴을 AI 에이전트에 알려 줍니다.

```bash
npx skills add decentraland/sdk-skills
```

전체 가이드와 [AI 바이브 코딩](https://docs.decentraland.org/creator/content-creator-ko/sdk7/getting-started/vibe-coding.md) 사용 가능한 스킬의 전체 목록은

{% hint style="warning" %}
**📔 참고**: 이전 씬 프로젝트에는 더 이상 사용되지 않는 `/dclcontext` 폴더가 있을 수 있습니다. 이 폴더는 폐기된 `npx sdk-commands get-context-files` 명령으로 다운로드한 것입니다. 이 컨텍스트는 더 이상 유지 관리되지 않으며 SDK Skills로 대체되었습니다. 해당 폴더는 안전하게 삭제해도 됩니다.
{% endhint %}

## 버전 관리

GitHub에 프로젝트 저장소를 만들고 이를 사용해 프로젝트 버전을 관리하고 다른 사람과 협업하는 것을 권장합니다.

방법을 잘 모르겠다면 [저장소 빠른 시작](https://docs.github.com/en/repositories/creating-and-managing-repositories/quickstart-for-repositories)을 참고하거나, 더 간편한 UI 기반 작업 흐름을 제공하는 [GitHub 데스크톱 애플리케이션](https://desktop.github.com/download/) 을 사용하세요.

{% hint style="warning" %}
**📔 참고**: 프로젝트 폴더 전체를 GitHub 저장소에 업로드하되, 동기화되지 않도록 `/node_modules` 및 `/bin` 폴더와 `package-lock.json` 파일이 모두 `.gitignore` 파일에 포함되어 있는지 확인하세요. 저장소 유형을 `node`로 설정하면 이렇게 되어 있어야 합니다. 이 파일은 모두 자동 생성되며, 컴퓨터에 따라 내용이 다를 수 있습니다.
{% endhint %}

## 관련 항목

* [AI 바이브 코딩](https://docs.decentraland.org/creator/content-creator-ko/sdk7/getting-started/vibe-coding.md): 원하는 내용을 AI 어시스턴트에게 설명해 씬을 만드세요.
* [스마트 아이템 - 기본](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/interactivity/smart-items.md)
* [스마트 아이템 - 고급](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/interactivity/smart-items-advanced.md)
* [상태 및 조건](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/interactivity/states-and-conditions.md)
* [모든 아이템을 스마트하게 만들기](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/interactivity/make-any-item-smart.md)
* [SDK 빠른 시작](https://docs.decentraland.org/creator/content-creator-ko/sdk7/getting-started/sdk-101.md): 빠른 입문을 원한다면 이 짧은 튜토리얼을 따라 해 보세요.
* [개발 워크플로](https://docs.decentraland.org/creator/content-creator-ko/sdk7/getting-started/dev-workflow.md): 처음부터 끝까지 씬을 만드는 방법을 알아보려면 이 문서를 읽어 보세요.
* [예제](https://docs.decentraland.org/creator/content-creator-ko/tutorials-and-examples/examples.md): 바로 예제 씬을 살펴보세요.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-ko/scene-editor/extend-with-code/overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
