Wheel Script

Hello every one
I have simple 3d cube and add it three cylinder (wheels) but I don’t know how can I attach them to cube with script and how to script for moving front and rotate and come back?
thanks

create a cylinder,

set cylinder rotation transform properties (in inspector view) to z=90

to make the cylinder move forward, put this script inside cylinder:

//

function Update () {

transform.Rotate(0,-1,0);

transform.Translate(0.1,0,0);

}