CREATE YOUR WORLD
Players & Characters : Advance...
텔레포트 구현
9min
ZEPETO 캐릭터가 두 지점으로 순간이동할 수 있는 포털을 구현합니다.

- 장면에서 ZEPETO 캐릭터 생성 코드를 기본값으로 구현합니다.
📘 다음 가이드를 참조하십시오. [ZEPETO 캐릭터 만들기]
1) 순간이동할 지점을 만듭니다.
- 이 가이드에서는 이를 A 지점과 B 지점으로 지칭합니다.
- 계층 구조 > 3D 객체 > 평면을 생성하고 이름을 Plane_A로 변경합니다.

2) 텔레포트를 시작할 Portal 객체를 추가하세요.
- 객체와 상호작용할 수 있도록 Collider를 추가하세요.
- 충돌을 감지할 수 있는 영역의 크기를 조정하세요.
- Is Trigger를 체크하는 것을 잊지 마세요.

3) 같은 방식으로 총 2개의 텔레포트 포인트를 생성하세요.

텔레포트 포인트 A의 예

텔레포트 포인트 B의 예
- 포인트가 겹치지 않도록 위치를 조정하세요.

1) 프로젝트 생성 > 생성 > ZEPETO > TypeScript로 이름을 Teleport로 변경합니다.
2) 아래와 같은 샘플 스크립트를 작성합니다.
- 스크립트가 부착된 객체의 충돌 영역에서 ZEPETO 캐릭터와 충돌이 감지되면 destinationObject로 텔레포트하는 로직입니다.
3) 스크립트 작성을 마친 후, 텔레포트를 시작할 Portal 객체에 스크립트를 추가합니다.
4) 인스펙터에서 목적지 객체를 할당합니다.
- 목적지 객체 : 텔레포트 끝에 도착할 포탈 객체입니다.

포털 근처에 있을 때 ZEPETO 캐릭터를 A 지점에서 B 지점으로 순간이동합니다.

- 이 가이드는 내가 조작하는 로컬 플레이어의 순간이동만 처리합니다.
- 멀티플레이어 월드의 경우, 다른 플레이어의 위치 동기화가 추가로 필요합니다.
- 멀티플레이 샘플의 동기화 구성 요소를 사용하면 위치 동기화가 쉽게 구현됩니다.
📘 멀티플레이 샘플 - Zepeto 멀티플레이 구성 요소 https://github.com/naverz/zepeto-multiplay-example/tree/main/Assets/Zepeto Multiplay Component