然後把想要複製的物件拖曳到攝影機裡的JavaScript中的YourObject
效果為每點擊一次滑鼠左鍵複製一次物件
Instantiate (物件, 座標(x,y,z), 方向(x,y,z))
var YourObject:Transform; var i:int = 1; function Update(){ if(Input.GetMouseButtonDown(0)){ Instantiate (YourObject, Vector3(i * 2, 0, 0), Quaternion.identity); i++; } }
複製物件並給複製物件轉向
var YourObject:Transform; var i:int = 1; function Update(){ if(Input.GetMouseButtonDown(0)){ Instantiate (YourObject, Vector3(i * 2, 0, 0), Quaternion.Euler( 0, i * 10, 0)); i++; } }
0 ♥:
張貼留言