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); }
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void OnControllerColliderHit(ControllerColliderHit hit) { hit.gameObject.SendMessage("ApplyDamage", 5); } }
Did you find this page useful? Please give it a rating: