my background is not scrolling why?

I have this good script but its not scrolling?

its a 2d game
using UnityEngine;
using System.Collections;

public class bgscroll : MonoBehaviour {

	public float speed = 0.2f;

	// Use this for initialization
	void Start () {
	// Update is called once per frame
	void Update () {
		Vector2 offset = new Vector2 (Time.time * speed, 0);

		GetComponent<Renderer>().material.mainTextureOffset = offset;

Have you set your Texture’s wrap mode to “Repeat”?
If not, cllick on your texture in the Hierarchy and check the Inspector tab.