/////////////////////////////////////////////// private GameObject GetObstacle(ObjectPool pool) { GameObject obstacle = pool.getNextObject (); var pos = pool.prototype.transform.position; obstacle.transform.position = new Vector3 (pos.x, pos.y, pos.z); return obstacle; }