ParallaxBackground loading new sprites too late when mirrored?

Godot Version

4.2

Question

I am trying to add an infinite parallaxBackground and I get the basic setup (ParallaxBackground → ParallaxLayer → Sprite). My problem is that when I activate mirroring (with the width of the sprite) I get the weird issue that the sprite loads in too late, which looks really weird.

As a test, I created a basic scene with a small Godot logo moving right and large Godot sprites as an infinite background parallax. It looks like this in the editor:

But once I run the game it stops working:
2024-06-06 09-32-35

I looked through a bunch of forums and tried things like:

  • toggling ignore camera zoom (in ParallaxBackground)
  • set mirroring to twice the size of the sprite and then adding a second sprite
  • Disbabled centered in the Sprite2D

but none of those options seem to work; am I getting something fundamentally wrong with Parallax? It’s super frustrating

Here is the node setup:
Screenshot 2024-06-06 094402
(the script simply moves the Sprite2D right at a constant speed)

Here is the ParallaxLayer node, I set mirroring to the width of the Godot logo
Screenshot 2024-06-06 094513

Mirroring is kinda finicky. It looks like the position of the sprite is not at 0,0 and that creates the problem you are seeing.

The new Parallax2D node that will be available in Godot 4.3 seems to be easier to setup and use Parallax2D Progress Report