Skip to main content
2 of 3
added markdown to code in text, removed fluff text
Pikalek
  • 13.4k
  • 5
  • 49
  • 54

Scroll UI Image

Currently, I am scrolling a UI RawImage using the following:

[SerializeField] private RawImage _imageToScroll;
[SerializeField] private float _x, _y;
// Update is called once per frame
void Update()
{
    _imageToScroll.uvRect = new Rect(_imageToScroll.uvRect.position + new Vector2(_x, _y) * Time.deltaTime, _imageToScroll.uvRect.size);
}

However, I need to use a regular Image, rather than RawImage. Is there a similar and simple way to accomplish this scrolling effect with Image?