Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ControllerColliderHit

Namespace: UnityEngine

Description

ControllerColliderHit is used by CharacterController.OnControllerColliderHit to give detailed information about the collision and how to deal with it.

Variables

colliderThe collider that was hit by the controller.
controllerThe controller that hit the collider.
gameObjectThe game object that was hit by the controller.
moveDirectionApproximately the direction from the center of the capsule to the point we touch.
moveLengthHow far the character has travelled until it hit the collider.
normalThe normal of the surface we collided with in world space.
pointThe impact point in world space.
rigidbodyThe rigidbody that was hit by the controller.
transformThe transform that was hit by the controller.