-1
嗨我正在一個簡單的遊戲項目,我想實例化一個gameobject從我觸摸屏幕的位置我寫了下面的代碼,但座標不匹配。它實例化對象,但我不能看到它出現在屏幕上,我認爲有件事我錯過了解決這個問題,我不知道是怎麼這裏的代碼:統一c#觸摸座標
if (Input.GetTouch(0).phase == TouchPhase.Began)
{
Debug.Log("touch begun" + Input.GetTouch(0).position);
Vector3 touchDeltaPosition = Input.GetTouch(0).position;
Instantiate(bulletPrefab, Input.GetTouch(0).position, Quaternion.identity);
}