- Home /
Question by
Horonge · Apr 26, 2014 at 08:11 PM ·
rendererbackgroundscrolling
Simple scrolling background (2D). A small problem with my oneline code
Why whont this code work properly?
public float speed = 0.2; void Update(){ renderer.material.mainTextureOffset = new Vector2(Time.time * speed, 0f); }
So it will scroll, but not start over from the beginning. Insted the image is copying itself at the end, making a mess.
Where is my mistake? I have used it before, and it worked then. Im really confused
Comment
Best Answer
Answer by meat5000 · Apr 26, 2014 at 08:11 PM
Click the texture
textureimporter.jpg
(30.6 kB)
Glad to help!
Please accept the answer if it solved your problem :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613143641im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
So, what's the problem with this code? 1 Answer
2D Parallax Background 4 Answers
Moving Background with translated images 1 Answer
Making a point and click background. 0 Answers