Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

ControllerColliderHit.collider

Switch to Manual
public Collider collider;

Description

The collider that was hit by the controller.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnControllerColliderHit(ControllerColliderHit hit) { hit.gameObject.SendMessage("ApplyDamage", 5); } }