Here is the code:
target = new Vector3 (Random.Range (-4.7f, 0), Random.Range (-2.75f, 3.5f), 0);
// Move to the random position
transform.position = Vector3.MoveTowards (transform.position,
target, speed * Time.deltaTime);
I want to move my gameobject automatically but it turns out that the gameobject only move a very short distance. I put it in Update() and make a if statement which used to control my gameobject stop until it move to the random position