- Home /
Question by
LeleUnity · Jul 30, 2016 at 10:05 PM ·
backgroundquadendless
Background on a Quad
Hello, I wanted to create an endless background of 3840*2160. I created a quad and applied the background as texture on top of it but of course the pitcure is squeezed and I dont want any manual rescale which will break the original resolution.
Could you tell me how to create a precise endless background of 3840*2160 ? thank you
Comment
Answer by The-Evster · Jul 31, 2016 at 02:44 PM
public float Speed = 0.5f;
public Renderer rend;
public Camera sceneCam;
public GameObject self;
void Start()
{
sceneCam = Camera.main;
self = gameObject;
}
void Update()
{
Vector2 offest = new Vector2(Time.time * Speed, Time.time * Speed);
rend.material.mainTextureOffset = offest;
}
Could you explain me your code ? you are setting the offset to the Renderer so? I need to create a precise endless background of 3840*2160 (on a quad or in whatever way) thank you