Scroll using material.mainTextureOffset makes the texture very distorted

Hey, Everyone, I am using a simple line of code to scroll the texture in material to get a moving background feel.

    public float scrollSpeed;
    private MeshRenderer backgroundImage_Menu;
    private float offset;
    private void Start()
        backgroundImage_Menu = GetComponent<MeshRenderer>();

    private void Update()
        offset += (Time.deltaTime * scrollSpeed) / 10f;
    //    backgroundImage_Menu.material.SetTextureOffset("_MainTex", new Vector2(offset, 0));
        backgroundImage_Menu.material.mainTextureOffset = new Vector2(offset, 0);

Here is the pretty basic code to scroll the texture. But using it makes the texture scroll but distorts it from the side it started moving(It’s hard to understand what I said, so Attaching an Image)

This is what the texture looks like
This is what the texture looks like

And, this is what happens after scrolling for a while
this is what happens after scrolling for a while

Do you see what’s happening here? I have no idea why it’s happening. This used to work before. I have used it before and it worked last time. But, I am not really sure why it’s happening this time. I also checked with the official unity document here and they did pretty much the same thing. Can this be a bug? Please any suggestions would be appreciated.

Thank you :),

stay safe during this pandemic,

Bhavin Lathia.

This looks like what happens when the Wrap Mode of the texture is set to “Clamped”. Check your texture’s import settings and make sure it is set to “Repeat” or “Mirror”.

You can find additional information about the Texture Importer here: