How do I get parallax layer mirroring to work properly?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Socrates

When I make a parallax background and use mirroring, it shows up correctly in the editor, but when i run the game, the sprite is only mirrored well after it is visible in the viewport, so it seems that it is suddenly popping into existence. Two of the layers I put in work correctly without any problem and the other two do not., so I have no idea what I could be doing wrong.

I’m having a similar issue in addition to some other ones with my parallax background. I noticed that this wasn’t noticeable when I set my camera zoom to (1,1), but that doesn’t seem like a fix so much as it is a workaround.

soundchaser.jon | 2018-07-20 23:40

So I was having the same problem as you. You might try ignore camera zoom under the parallaxbackground parent.

The problem that I was having, and it kinda sounds like the same problem you are having, is that mirroring in parallaxlayer only mirrors the image once, by the x and y parameters, which should be the same as your image size.

Now the problem for me was, my image (a simple sky), was too small, so while it is getting mirrored correctly as I move through the level, it was only filling about half the scene, since the image I was mirroring was so small.

The reply below from somebody else suggested changing the scale of the image, which is what I tried initially and … is fine, but kind of a crappy fix since you lose the resolution of your original image.

What I did which worked well, was just to make the image bigger. I opened it up in krita, tripled the canvas size on the x axis, then copypasted the original image twice, lined the three pieces up in the bigger canvas, merged the layers, and boom, now I have a sky background that’s 3x as wide, and easily fills the scene as it gets mirrored.

aniratepanda | 2021-06-10 19:22

:bust_in_silhouette: Reply From: shmellyorc

Easy. never go triple the size of the image size.

Example if your width of the image is 800, never go past (800x2)=1600. it only mirrors once.

Hi, i know that this was asked long time ago, but i’ve set mirror to the exact image size and this still happens. Any hints?

p7f | 2019-01-05 22:47

Play with ParallaxBackground parent node. If you set it’s CanvasLayer node’s scale values you will probably get it right. Worked for me :slight_smile:

ziher4 | 2019-07-27 21:05