sorry for another beginner question. I'm testing this texture offset code on a plane:

var scrollSpeed:float;  //set to .3
function Update () {
if(Input.GetKey("d")){  
    renderer.material.SetTextureOffset("_MainTex", new Vector2(Time.time*scrollSpeed, 0));
    }
}

the scrolling works fine, but everytime I let go of the d key and press it again, i get a jump, like a quick offset.. I'm thinking it probably has something to do with the time code.. any ideas?

Thanks

Time.time moves regardless of whether the D key is down or not...it's just the time that has passed. So it will 'catch up' if you let go of the key and press it again.

I think what you want to do is something like this:

var scrollspeed : float = 0.3;
private var offset : float = 0.0;

function Update() {
 if(Input.GetKey("d"))
 {
   offset += Time.deltaTime;
   renderer.material.SetTextureOffset("_MainTex", new Vector2(offset, 0));
 }

}

This code does essentially the same thing except that the offset will only add time if you have the key down.

Instead of using Time.time, use your own timer variable, and have it increase when the key is down. The jump is because Time.time continues increasing whether you're holding the key or not.