How to correctly move backgrounds using texture offset

I am trying to create a moving 2d background for a platformer by offsetting the texture of a Quad (mainTextureOffset). The offset moves to match the camera movement, it sort of works, but instead of the texture tiling, i get some wacky effect. Anyone know what I am doing wrong?

The code i am using is in a BackgroundScroller class attached to the background component.

public class BackgroundScroller : MonoBehaviour {

    public static BackgroundScroller current;

    private float lastCameraPos;

    void Start () {
       
        lastCameraPos = Camera.main.transform.position.x;
       
    }

    void Update () {
       
        float shift = Camera.main.transform.position.x - lastCameraPos;
        lastCameraPos = Camera.main.transform.position.x;
        Vector2 offset = renderer.material.mainTextureOffset;
       
        offset.x += +shift * 0.01f;
    
        renderer.material.mainTextureOffset = new Vector2 (offset.x, 0);
    }
}

Do i need to check the offset.x on update and move the texture manually once its off screen?
Thanks

Is the Wrap Mode in your texture set to Repeat?

No I didn’t! (still noob’n it out).
Thats great, thanks a lot.

also, logging the offset.x i notice that the x pos keeps increasing and does not reset. Is there any issue with this? Is it beneficial to reset the offset manually? example:

if (offset.x >= 0.1f) {
offset.x -= 0.1f;
}