📜  如何移动游戏对象 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:00.300000             🧑  作者: Mango

代码示例2
//Attach this to the oject you want to move
public GameObject Bullet
public GameObject Cannon

void Start()
{
 (Bullet) = GameObject.Find("Bullet"); //These are to find the object to move to
 (Cannon) = GameObject.Find("Cannon"); 
 Bullet.transform.position = Cannon.transform.position; //this is to move the object
}