Manual     Reference     Scripting  
  
Scripting > Runtime Classes > ControllerColliderHit   
  • Menu
  • Overview
  • Runtime Classes
  • Attributes
  • Enumerations
  • Editor Classes
  • Attributes
  • Enumerations
  • History
  • Index
  • ControllerColliderHit
  • All Members
  • Variables
  • collider
  • controller
  • gameObject
  • moveDirection
  • moveLength
  • normal
  • point
  • rigidbody
  • transform

ControllerColliderHit.moveDirection  

var moveDirection : Vector3

Description

Approximately the direction from the center of the capsule to the point we touch.

This can be used to find a reasonable direction to apply forces to touched rigidbodies.

JavaScript
function OnControllerColliderHit(hit : ControllerColliderHit) {
Debug.Log(hit.moveDirection);
}

using UnityEngine;
using System.Collections;

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

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def OnControllerColliderHit(hit as ControllerColliderHit):
Debug.Log(hit.moveDirection)