Question by
Hoskins355 · Aug 29, 2015 at 02:04 PM ·
guiimageoffset
How do you change offset Image UGUI?
using UnityEngine.UI;
public class Tiles2 : MonoBehaviour {
public Image backgroundImage;
public float scrollSpeed = 0.25F;
// Update is called once per frame
void Update () {
float offset = Time.time * scrollSpeed;
backgroundImage.material.SetTextureOffset("_MainTex", new Vector2(offset, offset));
}
This doesn't work or give any errors. Any ideas?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612001919im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Inconsistent visibility of small sprites 0 Answers
How do I take a GUI Image and switch to a different image on a certain collision/trigger? 0 Answers
Images won't tile or offset 1 Answer
Unity 5.2.2 - Canvas Button, Image, Text - Crashes on Android Immediately 1 Answer
Panel content size fitter not working 2 Answers