Why does my parallax background not render as expected?

Godot Version

4.7

Question

Super basic question sorry :sweat_smile:. I don’t understand some things I am seeing in regards to parallax backgrounds. I think it may come down to a fundamental misunderstanding of how they operate. I have a scene setup with the following layout:

The big gradient box is the child of the Parallax2D node. The other Sprite2D is the Godot icon. My Parallax2D node has the following properties:

I would expect that, withScroll Scale = (0,0), andFollow Viewport = True, the Sprite2D under the parallax node would kind of be “bound” to the viewport as it appears in the editor. However, when I press play, I see this:

There’s my sprite, but I can only see the very bottom right of the parallax Sprite2D box. Why is this? I assumed that it should be fixed to the camera location. In fact, no matter where I move the camera on the screen I still see just that little corner of the parallax box.

It this your parallax node origin:

It’s origin will snap to the viewport origin if follow viewport is enabled.

No I thank that’'s the root node origin. The origin of the Parallax2D node is right under the camera here:

Try setting scroll_scale to (1,1)

Now the box is in the viewport, but it doesn’t stay fixed in place when the camera moves (expected though, of course) :thinking:.

For context: The effect I am trying to achieve is to have a few layers of parallax props, but the very back one be fixed in place. That’s the one I’m starting with. So that’s where the initial idea of setting the scroll speed to (0,0) came from.

There’s parallax tutorial in the docs. You might want to check it out.