Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Problems with infinite scrolling 2d background

Discussion in '2D' started by StrayPyramid, Oct 1, 2020.

  1. StrayPyramid

    StrayPyramid

    Joined:
    Apr 25, 2020
    Posts:
    2
    Hi Everyone,

    I am trying to create an infinite scrolling 2d background. A sprite from a sprite sheet is moved to the left every tick. When it falls of the screen, its position is reset. To create the effect of an infinite scrolling background, the script that moves the sprite also creates another game object with the same sprite, and sets its parent to the first sprite.

    The problem I am having is that during Play, the sprite will show a vertical purple line - that is actually part of the spritesheet I am using.
    Since the frame dimensions of the sprite from the spritesheet should be constant, I have no idea why the purple background of the spritesheet is showing.
    Discord_WQH512BwDf.png

    Is there any solution to this?
    Spritesheet is attached.
     

    Attached Files:

  2. StrayPyramid

    StrayPyramid

    Joined:
    Apr 25, 2020
    Posts:
    2
    I have also tried using Unity's sprite tiling feature, which also produces the same result.

    The purple line mostly appears when the game skips or lags a little.