2Dprivatevoid OnTriggerEnter2D(Collider2D other){if (other.gameObject.GetComponent<AttackBox>()){hitPos = other.bounds.ClosestPoint(transform.position);print("碰撞点" + hisPos);}} 3Dother.gameObject.GetComponent<Collider>().ClosestPointOnBounds(transform.position); 原文:https://www.cnblogs.com/sanyejun/p/12753488.html