// Instantiate new pickup and move it from startPos to endPos in time seconds public static GameObject SpawnPickup(int id, Vector3 startPos, Vector3 endPos, float time, int valueOverride = -1) { GameObject pickup = SpawnPickup(id, startPos, valueOverride: valueOverride); instance.StartCoroutine(MoveObject(time * 1000, pickup, endPos)); return(pickup); }