將物件產生到指定位置的方法

views

參考

in C#

transform.position = new Vector3(7, 0.5 -7);

instantiate (mySpawner, transform.position, Quaternion.identity);

應用:將產生器/怪物產生在指定位置 如果要隨機位置可以配合Random功能使用

This entry was posted in Unity, 遊戲開發 and tagged , by Mr.M. Bookmark the permalink.


Leave a Reply

Your email address will not be published. Required fields are marked *