- Home /
Getting rid of Scrolling Uv Jitters
Hello,
I have a plane in the background of my game and I have a script for material offset attached to it. It works great but the jitter gives me a headache and I am sure that's not good for people playing it as well. Its just a slight jitter but it is noticeable enough. I was wondering if anyone had any answers as to why this is happening. I tried using deltaTime instead of Time.time but the background just jumps then doesn't move. I also tried setting a consistent frame rate but none of this changed it.
Here is the code I have:
using UnityEngine;
using System.Collections;
public class BackGroundScroll : MonoBehaviour {
public static float BGscrollSpeed = -0.5f;
void Update ()
{
renderer.material.mainTextureOffset = new Vector2 (0, (Time.time * BGscrollSpeed % 1));
}
}
Thanks for the help in advance!
But i need it to endlessly scroll, and that keeps the UVs in the 0-1 range.
Don't remove the modulo. There's nothing in that script that would cause any jitters.
Thanks Eric and I was afraid of that haha, ok I will have to look into another area then. It's just when the background moves up the screen its almost like it is flashing slightly around some of the clouds I have on the plane(BG) and i don't want anyone to have a seizure or something.
removed comment. Couldn't see anything that would cause jitter so suggested that. Jitter is probably caused because of fast scrolling speed.
Thats what I started thinking but it does need to move at that speed because any slower it just doesn't look right. Thanks for your responses. I might just have to submit the game as is to apple and see if it gets rejected for that. I haven't had anyone complain about it but i haven't had many testers either. I might just be over thinking it.