Question by
makaka-org · Nov 28, 2015 at 09:16 PM ·
backgroundscrollscrolling
2D Background Scrolling Problem - Twitching
I need 2D SCROLLING BACKGROUND.
In Unity Editor - Background twitches. On ios device - twitching increases. And after 10 minutes background move more jerkily.
I play with VSyncCount - does not help.
Get Demo project .
using UnityEngine;
using System.Collections;
public class BackgroundScroller : MonoBehaviour {
public float speed = 0.05f;
public bool isRunning = true;
private Vector2 offset;
private Renderer rend;
private float timeCounter = 0f;
void Awake()
{
rend = GetComponent<Renderer>();
}
void Update ()
{
if (isRunning)
{
timeCounter += Time.deltaTime;
offset = new Vector2(timeCounter * speed, 0f);
rend.material.mainTextureOffset = offset;
}
}
}
What's wrong?
P.S. If i use offset scroller - the same problem
test.zip
(314.7 kB)
Comment
Your answer
Follow this Question
Related Questions
move automatically to item in scroll rect 0 Answers
How to prevent scroll rect's content from moving after it reached its borders? 0 Answers
Increase speed when object hits collider ? 0 Answers
Parallax Scrolling Performance Issue - Gets Laggy after a bit 0 Answers
Acceleration problem with infinite scrolling background 0 Answers