انا شغال في اليونيتي اولا
ازاي لما اعمل Instantiate في الجافا السكربت اخلي الجيم اوبجكت يطلع في المكان الي الماوس يضغط عليه
ازاي لما اعمل Instantiate في الجافا السكربت اخلي الجيم اوبجكت يطلع في المكان الي الماوس يضغط عليه
public GameObject Ball; void Update () { if (Input.GetMouseButtonDown (0)) { Ray Myray = Camera.main.ScreenPointToRay (Input.mousePosition); RaycastHit Hit; if (Physics.Raycast (Myray , out Hit)) { Instantiate (Ball , Hit.point , Quaternion.identity); } } }
public GameObject Ball; void Update () { if (Input.GetMouseButtonDown (0)) { Ray Myray = Camera.main.ScreenPointToRay (Input.mousePosition); RaycastHit Hit; if (Physics.Raycast (Myray , out Hit)) { Instantiate (Ball , Hit.point , Quaternion.identity); } } }
تعليق