How to correct the positional offset caused by changes to the ScrollScale in Parallax2D?

Godot Version

4.6.2

Question

I am a beginner and have recently encountered some issues whilst using Parallax2D. It is a very simple scene: a player, a camera that follows the player, and a parallax background image. I used the Parallax2D node to achieve this effect. Within Parallax2D, there is a Sprite2D node; by default, the centre points of both the Sprite2D and the camera2D are at (0,0). When the player moves left or right, the Parallax2D follows suit, which is fine. but when I change the Parallax2D’s ScrollScale to adjust the parallax speed, the rendering position of the Sprite2D within the camera becomes misaligned. I’m not sure what the best way is to correct this misalignment; please could you offer some assistance? Thanks.

It would help to see a screenshot of your game. It would also help for you to tell us what is happening and what you want to happen in detail. And why and how you are changing it. Also a screen shot of your settings in the Inspector would be helpful. something like this:

As shown in the image, the left-hand side displays the structure of my test scene, whilst the right-hand side shows the effects of the parameters. In fact, I have kept almost all node properties at their default values. After adjusting the scroll scale and running the scene, the initial position of the background shifts, resulting in a discrepancy with the preview in the scene. Having consulted the relevant documentation, I understand that such modifications may cause coordinate shifts. I would like to know the correct method for correcting this shift, or how to avoid this issue altogether. Many thanks.

The best way I’ve found is to use the Prallax2DPreview plugin to preview in the editor, where each node position will be relative to the camera position. Without this, all you’re going to be doing is guess work.

How come the repeat size changed between the two screen shots?

I’m very sorry, but after the first design screenshot, I replaced it with an image where the boundaries were easier to make out, and then reset the repeat dimensions; the property settings for the visual effect remain the same.

Right, I’ll give it a go. Thanks.