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.gameObject  

var gameObject : GameObject

Description

The game object that was hit by the controller.

JavaScript
// Objects we touch, move them to position (0, 0, 0)
function OnControllerColliderHit(hit : ControllerColliderHit) {
hit.gameObject.transform.position = Vector3.zero;
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void OnControllerColliderHit(ControllerColliderHit hit) {
hit.gameObject.transform.position = Vector3.zero;
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def OnControllerColliderHit(hit as ControllerColliderHit):
hit.gameObject.transform.position = Vector3.zero