Unity How to create a scrolling Background

  • Create a Material with your background image;
  • Create a Plane and set the Mesh renderer Material to your material;
  • Make sure your X and Y rotation is set properly so that the Plane is visible for your Main cam;
  • Create and add a scrolling script to your Plane;
Scrolling.cs
public class Scrolling : MonoBehaviour {
	void Update() {
		float offset = Time.time * 0.1f;
		renderer.material.SetTextureOffset("_MainTex", new Vector2(offset, 0));
	}
}
  • Drag your Plane onto your Main Camera so it becomes a child and moves along with your camera;
Navigation
Print/export
Toolbox