collider
The collider that was hit by the controller.
阅读时间1 分钟最后更新于 1 个月前
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); }}