How to rotate shader/texture?

Hi, I am building roads. I made a model road that I can stretch and manipulate in unity. I imported it, and put my road texture onto it and it is on sideways… is there an easy way to rotate the texture? Thanks

You can modify material.mainTextureOffset:

var offset =;
var speed: float = 0.5;

function Update(){
  offset.y = (offset.y + speed * Time.deltaTime) % 1;
  renderer.material.mainTextureOffset = offset;

This simple script should be attached to the road, and scrolls the texture in its Y direction. You can modify it to scroll in the X direction (replace y by x) or scroll in the reverse direction (use a negative speed). Notice that the offset is kept in modulo 1: the texture offset can’t handle big numbers accordingly due to its limited precision.