Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

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

ControllerColliderHit.collider

Switch to Manual
public var collider: Collider;

Description

The collider that was hit by the controller.

function OnControllerColliderHit(hit : ControllerColliderHit) {
	// Call a damage function on the object we hit.
	hit.gameObject.SendMessage("ApplyDamage", 5);
}