Version: 2022.3
언어: 한국어
public float moveLength ;

설명

How far the character has travelled until it hit the collider.

Note that this can be different from what you pass to CharacterController.Move, because the initial movement vector is decomposed into a set of movements, according to CharacterController.stepOffset.

See Also: ControllerColliderHit.moveDirection.

using UnityEngine;

public class ExampleClass : MonoBehaviour { void OnControllerColliderHit(ControllerColliderHit hit) { Debug.Log(hit.moveLength); } }