- Home /
Scrolling Bg Parallax seams appear every alternate spawn
hey everyone. i am having a persistant issue that i am just not able to get around. I have tired everything i could and still the issue pertains. i am hoping i can get some clarity on what i might be doing wrong here. here goes.
i have a 2D scrolling bg with 3 layers. for each layer i have a prefab, which is spawned at the edge of the screen on the right side, moves towards the left side and when it exits the screen it is removed. see the image below.
when the sprite prefab is destroyed, another one is instantiated at the left hand edge of the camera. this is where the problem begins. no matter how much i try there is always a gap on every alternate instantiation. meaning both the prefabs will align perfectly once then on the next instantiate will have a big gap. i cant figure out what is it that i am doing wrong. i saw a lot of differnt peope post here with the same issue and i tried every solution mentioned there but it doesnt work for me. any help is hugely appreciated.
Without seeing some code not sure what is causing it. Did you take in account the movement when instantiating the position of the new object?
hey thanks for the response. i think i figured it out, the problem is that unity doesnt allow sprites larger than 1024 in width. the gap that i have in between the sprites is equal to the difference in the actual sprite size and the compressed 1024 width size. i looked up the error that i was getting
CompareApproximately(dstRatio, srcRatio, 1.0f/32.0f) UnityEditor.DockArea:OnGUI()
I believe someone from unity $$anonymous$$m is looking at this issue right now.