Changing material offset clips end of sprite.

I’m currently using a sprite with an unlit/transparent material attached in order to implement some parallax background scrolling. However, as the sprite is scrolled, part of the sprite is getting clipped on the right-hand edge.

The video to show the effect in action is here:

Finally, the code to do the scrolling is here:

public class ParallaxBackground : MonoBehaviour
{
    [SerializeField] private float scrollSpeedRatio = 1.0f;
    private Material material;

    private void Awake()
    {
        material = GetComponent<SpriteRenderer>().material;
    }

    //This method should be called repeatedly in an Update method (see the ParallaxScroller class).
    public void StepScroll(float speed)
    {
        float offset = Mathf.Repeat(material.mainTextureOffset.x + speed * scrollSpeedRatio * Time.deltaTime, 1.0f);
        material.mainTextureOffset = new Vector2(offset, 0.0f);
    }
}

I’ve also added some images in case they would be of any assistance:
Clipped:
9498904--1337710--clipped_sprite.png

Normal:
9498904--1337713--normal_sprite.png

Any insights as to why this effect is occurring is greatly appreciated. Thanks!

Is your Sprite is in Tight Mode? If so, it might be because it exceeds the Mesh when UV offsets.

Sorry, this is the first time I’m hearing about “Tight Mode”. What would that be?

Hi, it is at sprite import settings.
Try switching to Full Rect and see if it resolves your issue.
9503410--1338820--螢幕擷取畫面 2023-12-01 104435.png