如需转载,请保留本文链接。
错误代码如下:
public GameObject gameObject ;
void Start ()
{
gameObject = new GameObject();
}
void Update ()
{
gameObject.transform.position = Vector3.right*3* Time.deltaTime;
}
正确代码如下:
public GameObject gameObject ;
void Start ()
{
gameObject = new GameObject();
}
void Update ()
{
gameObject.transform.position += Vector3.right*3* Time.deltaTime;
}