• Godot Help
  • Godot 4.0.3 Parallax Background / Layer Issues

I am relatively new to Godot 4 and have been trying out some tutorials to learn. Most have worked without issues, where any issues are just due to slightly outdated methods. My most recent tutorial is by CodingQuests: published by freeCodeCamp.

Unfortunately, I am stuck on the Parallax section... Nothing seems to work and anything I try seems to make things worse. I followed step by step multiple times and cannot get the infinite background to work as in the video. I am not sure if this is a version issue or if I am doing something wrong with settings (none of which I have changed unless stated in the video).

I am trying this get this to work in its most basic form with a single layer and image. I am using the same asset image as in the video and just trying to make the mirror work. Filling the image to the screen width makes it 1152px long, so I set the x mirror to 1152px, and nothing happens (), errors are to do with assets not in use.

If I duplicate the sprite with the mirror still on it will create a duplicated instance and then it looks like the mirror works. I can move the duplicated instance to a different position and see that it now looks like the mirror works for this instance but not the previous one ().

I then tested hiding the original sprite and it hide both the spite and the mirror of the second instance! When I try to hide the duplicated instance instead it will hide itself and the mirror. So hiding either of the only 2 sprites makes only 1 sprite appear and the mirror disappears ( & ).

There are a few more issues I had, specifically following the tutorial that I could not make sense of. Trying all the tinkering I could did not work.

Please can someone assist?

Thank you in advance.


    It is in Spanish but I hope it can work for you

    8 days later

    Wadey_56

    Is there anything going on with the script you have attached? If you reference the scene objects via the code, it may be over-riding something. The Youtuber didn't have a script this early in the steps so maybe check that a future step isn't changing something. There has to be a difference between that second Sprite, something to do with layering or visibility maybe.

    As per the ParallaxLayer documentation "If the length of the viewport axis is bigger than twice the mirrored axis size, it will not repeat infinitely, as the parallax layer only draws 2 instances of the texture at any one time." Project, Project settings --> Display --> Window - Viewport Width and Height is the default view. Be sure to check actual resolution of your images. Something may be resizing it.