Skip to content

CharacterControllerComponent

29thnight edited this page Nov 27, 2025 · 1 revision

CharacterControllerComponent

간단 설명: 플레이어/캐릭터 이동, 중력, 점프, 강제 이동(넉백 등)과 충돌을 처리하는 캡슐 기반 컨트롤러 컴포넌트.

라이프사이클

메서드 설명
Awake() 씬 콜렉션에 컨트롤러 등록
Start() 내부 초기화(사용자 정의 OnStart) 호출
FixedUpdate(dt) 물리 기반 이동 처리(OnFixedUpdate)
LateUpdate(dt) 후처리(OnLateUpdate)
OnDestroy() 씬에서 등록 해제

사용자 훅

메서드 설명
OnStart() 시작 시 초기화 로직
OnFixedUpdate(fixedDeltaTime) 물리 이동/속도 계산
OnLateUpdate(fixedDeltaTime) 회전/상태 후처리

이동/상태 제어

메서드 설명
Move(moveInput) 입력 벡터 설정(평면 이동)
IsFalling()/SetFalling(bool) 낙하 상태 조회/설정
IsOnMove()/SetOnMove(bool) 이동 중 여부 조회/설정
GetFinalMultiplierSpeed() 최종 속도 배율 조회
AddFinalMultiplierSpeed(speed) 배율 누적(버프 등)
GetBaseSpeed()/SetBaseSpeed(speed) 기본 이동 속도 조회/설정
GetMoveRestrict()/SetMoveRestrict(arr) 방향별 이동 제한 플래그(Up/Down/Left/Right)
ForcedSetPosition(pos) 물리 결과 무시하고 강제 위치 설정
SetAutomaticRotation(use) 이동 방향 자동 회전 사용 여부
TriggerForcedMove(velocity, duration, curveType) 커브/지속시간 기반 강제 이동 시작
StopForcedMove() 강제 이동 중단
IsInForcedMove() 강제 이동 진행 중 여부
SetLookDirection(dir) 사용자 지정 시선 방향 설정
ClearLookDirection() 사용자 시선 해제(자동 회전 복귀)

컨트롤러/움직임 정보

메서드 설명
GetControllerInfo()/SetControllerInfo(info) 반지름/높이/오프셋 등 기본 물리 정보
GetMovementInfo()/SetMovementInfo(info) 속도/가속/점프/중력/마찰 등 이동 파라미터
GetControllerID()/SetControllerID(id) 내부 식별자
GetCollisionCount() 현재 충돌 수

Transform 오프셋(ICollider)

메서드 설명
GetPositionOffset()/SetPositionOffset(pos) 위치 오프셋
GetRotationOffset()/SetRotationOffset(rot) 회전 오프셋

이벤트(ICollider)

메서드 설명
OnTriggerEnter/Stay/Exit(other) 트리거 상호작용 처리
OnCollisionEnter/Stay/Exit(other) 충돌 상호작용 처리

주요 프로퍼티

필드 설명
m_radius/m_height 캡슐 크기 파라미터
m_posOffset/m_rotOffset 오프셋(로컬 기준)
maxSpeed/acceleration 이동 최대 속도 / 가속도
staticFriction/dynamicFriction 지면 마찰 계수들
jumpSpeed 점프 초기 속도
gravityWeight 중력 비중(가중치)
m_fBaseSpeed 기본 속도값(내부)
m_fFinalMultiplierSpeed 누적 배율 속도
m_rotationSpeed 자동 회전 속도
m_bMoveRestrict 이동 제한 플래그 배열
상태 플래그 m_bIsFall, m_bOnMove, m_bHasInput, m_useAutomaticRotation
충돌 카운트 m_collsionCount
방향/속도 m_moveInput, m_lookDirection, m_hasCustomLookDirection

CreatorEngine

API Docs

API Reference
Main
PhysicsSystem
RenderEngine
ScriptBinder
Utility_Framework

etc

Clone this wiki locally