Question by
SynGT · Mar 28, 2016 at 12:06 AM ·
androidbackgroundscrollingparallaxbackgrounds
Parallax Scrolling Performance Issue - Gets Laggy after a bit
I created a Quad & set a texture to it, which I'm using as a scrolling background. After about 20-40 seconds into it on an Android device, it starts running choppy & get progressively worse. I'm not really sure what else to do:
using UnityEngine;
using System.Collections;
public class scroll : MonoBehaviour {
public float speed = 0.5f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
Vector2 offset = new Vector2 (Time.time * speed, 0);
GetComponent<Renderer>().material.mainTextureOffset = offset;
}
}
Comment