Moving an object a specific distance

Ok so what I’d like to do is basically just create an object that is able to wander around on its own. Maybe I am going about this the wrong way, but so far here’s what I have. I want the object to randomly pick a degree in which it will rotate, and then randomly assign a distance for the object to travel. I was thinking i could tell the object to rotate, and them move it forward in the direction it turned to.

var speed = 5.0;
var distance : int;
var direction : float;

function Generate(){
	distance = Random.Range(1,5);
	direction = Random.Range(1,360);

function Start(){

function SpawnMove(){
	transform.Rotate(0, direction, 0);

Add ‘transform.Translate(transform.forward * speed * Time.deltaTime);’ to your SpawnMove function.

Any reason why you don’t call your Generate() function in Update (or FixedUpdate/LateUpdate)?