1. 射线用 Physics.Raycast 都可以判断,用 collider.Raycast 只在某些(不明)情况下可以
void Update() { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; // if (collider.Raycast(ray, out hit, 100f)) if (Physics.Raycast(ray,out hit ,100f)) { Debug.DrawLine(ray.origin, hit.point); Debug.Log(hit.collider.gameObject.name+" "+Time.fixedTime); } }