float x = Random.Range (-15, 15);
float y = Random.Range (-4, 4);
Vector3 lastpos = new Vector3 (x, y, 0);
Vector3 currentpos = new Vector3 (x, y, 0);
Vector3 wu = Vector3.Lerp (lastpos, currentpos, speed * Time.deltaTime);
wu = wu.normalized;
if (tt >= 1) {
transform.Translate (wu * speed * Time.deltaTime, Space.World);
tt = 0;
} else {
tt += Time.deltaTime;
}
您看有什么问题?