Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


moveLength

How far the character has travelled until it hit the collider.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public float moveLength { get; }

Remarks

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.

Examples

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