+5 votes

Hi everyone,

I just started learing how to use Godot and stumbled across my first issue. I did everything as shown in various tutorials but whenever I use the Parallax Background and set up mirroring the new mirrored part of the background renders just after the end is visible in the player camera. So basically the next background part pops up on camera so one sees that just repeats. I set the x-value for mirroring to be the same as the width of the background image (just some trees for testing, so there is no y-axis to mirror).

Here a screenshot: image

What am I doing wrong? When I use the same image in a lot larger it seems to work but then my player figure is way too small.

Thanks for your help! :)

in Engine by (17 points)

6 Answers

+13 votes

Not sure if you figured this out already by I just ran into a similar problem today and thought I'd post what worked for me in case it helps someone else out.

The problem I ran into occurs specifically when the rendered sprite is smaller than the viewport - didn't have to take these steps with larger backgrounds, but for smaller images you may have to:

  1. Check the "import" tab on your image asset and make sure "Repeat" is set to "Enabled" - Reimport if needed
  2. On your Sprite, set Region to Enabled, x & y to 0 and w & h to some multiple of your sprite size which will cover the viewport
  3. On your ParallaxLayer, set Mirroring to the same values as your Region w & h (multiplied by your Sprite's scale factor if not set to 1)

Hope this helps!

by (34 points)
+1 vote

Have you tried setting "Ignore Camera Zoom" in Parallax Background?
In my case that was the reason.

by (16 points)
0 votes

So I had the same problem, and readjusting my test window to the same size of the region w & h seem to fix it.
Apparently the window was longer than the refresh borders.

If you found a different solution, could you share?
New to Godot.

by (14 points)
0 votes

In my case, the reason was that the sprite was centered.

sprite.centered = false

This fixed the problem.

by (20 points)
0 votes

i tried all this and no way.

but works for me keeping the sprite position respective to its father to 0

i mean

not move the sprite position. centered = false

move the parallax layer

by (18 points)
0 votes

Select Ingore camera zoom, it makes the parlleax bigger though which may be a problem for you. Denpending on the size of your camera and the parlleax pictures it will load before the camera sees it. If this doesn't work, rescale the picture(s) your using.

ago by (14 points)
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 Frequently asked questions and 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 [email protected] with your username.