> 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/sdk7/interactivity/avatars/locomotion.md). Agents can also search and read this documentation through its [MCP server](https://docs.decentraland.org/~gitbook/mcp).

# 이동 설정 및 제한

플레이어의 속도와 점프 높이를 변경하거나, 이동 방식을 제한합니다

씬 안에서 플레이어 아바타의 이동 방식을 변경할 수 있습니다. 속도와 점프 높이를 조정하려면 `AvatarLocomotionSettings` 컴포넌트를 사용하고, 플레이어를 움직이지 못하게 하거나 특정 유형의 이동을 차단하려면 `InputModifier` 컴포넌트를 사용하세요. 두 컴포넌트 모두 `engine.PlayerEntity`에 추가하며, 플레이어가 씬 경계 안에 있을 때만 효과가 적용됩니다.

## 이동 설정

달리기 속도, 점프 높이 등을 비롯한 플레이어의 이동 방식을 조정할 수 있습니다. 예를 들어 플레이어가 아이템과 상호작용해 일시적인 속도 증가 효과를 얻도록 하거나, 짧은 시간 동안 점프 능력을 비활성화하는 등 설정을 동적으로 변경할 수 있습니다.

{% hint style="info" %}
**💡 팁**: 코드를 작성하지 않고도 이 값을 설정할 수 있습니다. 씬에 **이동 설정** 스마트 아이템을 추가하고 [Creator Hub의 씬 편집기](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/get-started/about-editor.md) 에서 슬라이더를 조정하세요. 자세한 내용은 [이동 설정](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/interactivity/smart-items.md#locomotion-settings).
{% endhint %}

이렇게 하려면 `AvatarLocomotionSettings` 컴포넌트를 다음에 추가하세요. `engine.PlayerEntity`.

```ts
import {AvatarLocomotionSettings, engine} from '@dcl/sdk/ecs'

AvatarLocomotionSettings.create(engine.PlayerEntity, {
	runSpeed: 10,
	jumpHeight: 2,
})
```

다음 속성을 사용할 수 있습니다.

* `walkSpeed`: 플레이어가 걷는 속도(초당 미터)입니다. 데스크톱 클라이언트에서는 Ctrl 키를 눌러 걸을 수 있습니다.
* `jogSpeed`: 플레이어가 가볍게 달리는 속도(초당 미터)입니다. 플레이어의 기본 이동 방식입니다.
* `runSpeed`: 플레이어가 달리는 속도(초당 미터)입니다. 데스크톱 클라이언트에서는 Shift 키를 눌러 달릴 수 있습니다.
* `jumpHeight`: 플레이어가 점프하는 높이(미터)입니다.
* `runJumpHeight`: 달리다가 점프할 때의 높이(미터)입니다.
* `doubleJumpHeight`: 이중 점프 시 두 번째 점프의 높이(미터)입니다.
* `glidingSpeed`: 활공 중 플레이어의 수평 이동 속도(초당 미터)입니다.
* `glidingFallingSpeed`: 활공 중 플레이어의 최대 낙하 속도(초당 미터)입니다. 이 값은 플레이어의 하강 속도만 제한합니다. 씬의 지속적인 힘에 의한 상승처럼 위쪽으로 움직이는 경우에는 제한이 적용되지 않습니다.
* `hardLandingCooldown`: 강한 착지 후 적용되는 재사용 대기 시간(초)입니다. 높은 곳에서 떨어져 착지한 플레이어가 다시 움직일 수 있을 때까지 기다려야 하는 시간입니다.

참고로, 각 속성의 기본값은 다음과 같습니다.

* `walkSpeed`: 1.5m/s
* `jogSpeed`: 8m/s
* `runSpeed`: 10m/s
* `glidingSpeed`: 6 m/s
* `glidingFallingSpeed`: 1 m/s
* `jumpHeight`: 1 m
* `runJumpHeight`: 1.5 m
* `doubleJumpHeight`: 2 m
* `hardLandingCooldown`: 0.75초

{% hint style="info" %}
**💡 팁**: 활공 중에는 씬에서 지속적으로 가해지는 힘이 1.5배 강해지며, 위쪽으로 작용하는 힘은 플레이어를 들어 올릴 수 있습니다. 자세한 내용은 다음을 참조하세요. [활공 중 힘](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/player-physics.md#forces-while-gliding).
{% endhint %}

{% hint style="info" %}
**💡 팁**: 이러한 속성은 어느 것도 0보다 작을 수 없습니다. 음수 값을 설정하면 0으로 제한됩니다. 이 값을 0으로 설정하면 다음을 사용한 것과 같은 효과가 있습니다. `InputModifier` 를 사용해 특정 키의 사용을 차단하는 것과 같습니다.

플레이어가 씬의 경계 안에 있을 때만 플레이어의 이동을 제어할 수 있습니다. 다른 플레이어의 아바타에 영향을 주려면 해당 플레이어의 인스턴스에서 이동에 영향을 주는 코드를 실행해야 합니다.
{% endhint %}

만들 수 있습니다 [스마트 웨어러블을](https://docs.decentraland.org/creator/content-creator-ko/sdk7/kinds-of-projects/smart-wearables.md) 착용하면 플레이어가 항상 더 빠르게 달리거나 더 높이 점프하게 할 수 있습니다. 씬과 스마트 웨어러블에서 이 매개변수에 서로 다른 값을 정의한 경우에는 항상 씬의 값이 적용됩니다.

파쿠르 씬에서 누구도 부당한 이점을 얻지 못하도록 하려면 씬에 기본값을 명시적으로 추가해 기본 매개변수를 강제할 수 있습니다.

```ts
import {AvatarLocomotionSettings, engine} from '@dcl/sdk/ecs'

AvatarLocomotionSettings.create(engine.PlayerEntity, {
	runSpeed: 10,
	walkSpeed: 1.5,
	jogSpeed: 8 ,
	jumpHeight: 1,
	runJumpHeight: 1.5,
	hardLandingCooldown: 0.75
})
```

## 이동 제한

씬에서 플레이어가 수행할 수 있는 동작을 제한할 수 있습니다. 플레이어를 움직이지 못하게 하거나, 점프나 달리기를 방지하는 등 특정 이동 방식을 제한할 때 사용하세요.

### 플레이어 움직임 고정

입력 키를 눌러도 아바타가 움직이지 않도록 플레이어를 고정할 수 있습니다. 이는 다양한 게임 메커니즘에 유용합니다. 또한 움직임 때문에 중단되어서는 안 되는 중요한 애니메이션을 재생하는 동안이나, [가상 카메라](https://docs.decentraland.org/creator/content-creator-ko/sdk7/3d/camera.md) 가 아바타 반대쪽을 향하고 있어 플레이어가 앞을 보지 못한 채 움직이지 않도록 하고 싶을 때 플레이어를 고정하는 것이 좋습니다.

아바타의 이동에 플레이어의 입력이 영향을 주지 않도록 하려면 `InputModifier` 컴포넌트를 `engine.PlayerEntity` 에 추가하세요. 아바타는 움직이지 않고, 플레이어는 카메라만 회전할 수 있습니다.

```ts
import {InputModifier, engine} from '@dcl/sdk/ecs'

InputModifier.create(engine.PlayerEntity, {
	mode: InputModifier.Mode.Standard({
		disableAll: true,
	}),
})
```

다음 사항에 유의하세요:

* 플레이어의 상호작용이 비활성화되어 있어도 아바타는 중력이나 움직이는 플랫폼과 같은 외부 힘의 영향을 받습니다.
* 이  `InputModifier`  컴포넌트는 다음 엔티티에서만 사용할 수 있습니다:  `engine.PlayerEntity` 엔티티입니다. 현재 플레이어에게만 영향을 줄 수 있으며, 다른 플레이어에게는 영향을 줄 수 없습니다.
* 이 컴포넌트는 아바타가 씬의 경계 안에 있는 동안에만 플레이어에게 영향을 줍니다. 플레이어가 씬을 벗어나는 즉시 이동 제한이 해제됩니다.
* 플레이어의 상호작용이 비활성화된 동안 플레이어는 자유롭게 이모트를 실행할 수 없지만, 씬에서 아바타의 애니메이션을 트리거할 수는 있습니다.
* 플레이어 입력은 아바타에 영향을 주지 않지만, [전역 입력 이벤트](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/button-events/system-based-events.md#global-input-events) 는 씬에서 계속 수신할 수 있습니다. 이 이벤트를 사용해 탈것을 조종하거나, [가상 카메라](https://docs.decentraland.org/creator/content-creator-ko/sdk7/3d/camera.md) 를 사용해 다른 엔티티의 움직임을 따라가며 해당 엔티티를 대체 아바타처럼 취급할 수 있습니다.

### 특정 이동 방식 제한하기

플레이어의 움직임을 완전히 멈추는 대신, 특정 이동 방식만 제한할 수 있습니다. 예를 들어 더블 점프와 활공을 막아 플랫폼 게임의 난이도를 유지하는 등 게임플레이에 활용할 수 있습니다. 이러한 능력을 게임 메커니즘에 따라 동적으로 전환할 수도 있습니다. 예를 들어 플레이어에게 스태미나 바를 제공하고, 스태미나가 바닥나면 달리기를 막을 수 있습니다. 또는 평온한 분위기를 의도한 장소에서 달리거나 점프하지 못하게 하는 등 씬의 분위기를 조성하는 데에도 활용할 수 있습니다.  `InputModifier` 에는 다음 옵션이 있습니다.

* `disableWalk`: 플레이어가 천천히 걸을 수 없습니다(Control 키 누르기). 걸으려고 하면 허용된 경우 조깅이나 달리기를 합니다.
* `disableRun`: 플레이어가 달릴 수 없습니다(Shift 키 누르기). 달리려고 하면 허용된 경우 조깅을 합니다.
* `disableJog`: 플레이어가 조깅할 수 없습니다(기본 이동 속도). 조깅하려고 하면 허용된 경우 달리거나 걷습니다.
* `disableJump`: 플레이어가 점프할 수 없습니다.
* `disableEmote`: 플레이어가 자발적으로 이모트를 실행할 수 없습니다. 씬에서 플레이어 아바타의 애니메이션을 트리거할 수 있습니다.
* `disableDoubleJump`: 플레이어가 더블 점프를 할 수 없습니다.
* `disableGliding`: 플레이어가 활공할 수 없습니다.

```ts
import {InputModifier, engine} from '@dcl/sdk/ecs'

InputModifier.create(engine.PlayerEntity, {
	mode: InputModifier.Mode.Standard({
		disableAll: false,
		disableWalk: false,
		disableRun: true,
		disableJog: true,
		disableJump: true,
		disableEmote: true,
		disableDoubleJump: true,
		disableGliding: true
	}),
})
```

### 고급 구문

헬퍼 없이 이 컴포넌트를 사용하려면 다음 구문을 사용할 수 있습니다.

```ts
import {InputModifier, engine} from '@dcl/sdk/ecs'

InputModifier.createOrReplace(engine.PlayerEntity, {
	mode: {
		$case: 'standard',
		standard: {
			disableAll: false,
			disableWalk: false,
			disableRun: true,
			disableJog: true,
			disableJump: true,
			disableEmote: true,
		},
	},
})
```

{% hint style="info" %}
**💡 팁**: 작동하는 예시는 [`0,1-input-modifier`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/0,1-input-modifier) 테스트 씬을 참조하세요. 이 씬에서는 각 `InputModifier` 이동 플래그를 개별적으로 전환하며, 이동이 차단된 동안에도 움직이는 플랫폼이 아바타를 계속 운반하는 모습을 보여 줍니다.
{% endhint %}


---

# 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/sdk7/interactivity/avatars/locomotion.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.
