Question by
ThunderstruckGames · Nov 22, 2020 at 05:16 PM ·
c#scripting problembackground
How do I remove the seams from my scrolling background?
I'm making a 2D shooter game and can't seem to get my scrolling background to work. I have the scrolling part working but when it plays, there are seams in the background.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BGScroll : MonoBehaviour {
public float scroll_Speed = 0.1f;
private MeshRenderer mesh_Renderer;
private float x_Scroll;
void Awake() {
mesh_Renderer = GetComponent<MeshRenderer>();
}
void Update() {
Scroll();
}
void Scroll() {
x_Scroll = Time.time * scroll_Speed;
Vector2 offset = new Vector2(x_Scroll, 0f);
mesh_Renderer.sharedMaterial.SetTextureOffset("_MainTex", offset);
}
}
// Class
Comment
Your answer
Follow this Question
Related Questions
How do I fix my scrolling background,How do I fix my scrolling background? 0 Answers
Can someone please help me find out what wrong with my code. 0 Answers
How do i change a color of an individual alphabet of a UI.Text 2 Answers
How can i look for collisions of the bulidngs in may array ? how can i use OnTRiggerEnter/exit ? 0 Answers