RaycastHit hit;
if(Physics.Raycast(character.cam.transform.position, character.cam.lookDir, out hit)){
Debug.Log(hit.point);
}
此返回3到4個不同的值,一個幀,而無需移動或旋轉相機光線投射點返回多個值而無需移動
RaycastHit hit;
if(Physics.Raycast(character.cam.transform.position, character.cam.lookDir, out hit)){
Debug.Log(hit.point);
}
此返回3到4個不同的值,一個幀,而無需移動或旋轉相機光線投射點返回多個值而無需移動
它可能擊中多個目標。
我沒有使用raycastAll,即時通訊使用raycast –
,並且場景中只有一個地板 –
請發佈一個圖片,記錄下什麼值 –
你期待它做什麼? – lockstock
只給出一個單一的答案 –
「3到4個不同的值」,你是什麼意思? (即數字,對象,數組)在Unity3D的文檔中(https://docs.unity3d.com/ScriptReference/RaycastHit.html),RaycastHit的''''成員是一個'Vector3',所以你看到的3個值可能是它的組件。 – meowgoesthedog