Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


collider

The collider that was hit by the controller.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public Collider collider { get; }

Examples

using UnityEngine;public class Example : MonoBehaviour{ void OnControllerColliderHit(ControllerColliderHit hit) { // Call a damage function on the object we hit. hit.gameObject.SendMessage("ApplyDamage", 5); }}