Scroll Texture with Wrap

Hi - I really appreciate any help on this.

I want to scroll a texture across a plane but have the texture wrap itself as it goes off one end it comes back along the other. Think of clouds that scroll across a plane from right to left, as part of the first cloud goes off the left side of the plane it immediately starts to appear on the right side of the plane. My code is below…

private int materialIndex = 0;
	private Vector2 uvAnimationRate = new Vector2( 0.01f, 0.0f );
	private string textureName = "_MainTex";
	Vector2 uvOffset =;
	void LateUpdate()
		uvOffset += ( uvAnimationRate * Time.deltaTime );
		if( renderer.enabled )
			// This is choppy and doesn't 'wrap' correctly
			renderer.materials[ materialIndex ].SetTextureOffset( textureName, WrapVector(renderer.materials[ materialIndex ].GetTextureOffset(textureName) + new Vector2(0.1f, 0.0f) * 0.1f));
			// This just moves the texture from left to right no wrapping at all
			renderer.materials[ materialIndex ].SetTextureOffset( textureName, uvOffset );
	Vector2 WrapVector(Vector2 input)
		return new Vector2(input.x - (int)input.x, input.y - (int)input.y);	

Thank you - this worked. I had my Texture Type as GUI so I didn’t see this option before. After changing the texture type to texture the option to ‘Repeat’ was available