+1 vote

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.

in Engine by (529 points)

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.

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.

1 Answer

0 votes

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.

by (109 points)

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?

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.