Unity - Scripting API: Object.Instantiate

This function makes a copy of an object in a similar way to the Duplicate command in the editor. If you are cloning a GameObject you can specify its position and rotation (these default to the original GameObject's position and rotation otherwise). If you

docs.unity3d.com

wergia.tistory.com/213

위 링크에서 스크린 좌표와 월드 좌표에 관한 설명을 보던 중 마우스 위치 좌표가 월드 공간의 좌표로 변환된다는 내용이 있었는데, 코드에는 World포지션으로 바꾸는 코드가 없었다.

 

그래서 Instantiate함수를 사용할 때 자동으로 스크린 좌표 -> 월드 좌표로 바뀌는지 알아보려고 공식문서를 보았다.

 

내용 중에 "If the position and rotation are specified, they are used as the object's position and rotation in world space." 라는 내용이 있었는데, Instantiate함수 파라미터에 position과 rotation을 지정해주면 이것이 world space공간에서 사용된다고 한다. 즉, 자동으로스크린좌표에서 월드좌표로 바뀐다.