Godot Version
Godot Engine v4.6.2.stable.steam [71f334935]
Question
I’m working on a 2D Platformer and am having some trouble with the Parallax2D node’s Scroll Offset.

Here I have a working example of what I’d like to accomplish. In the background there are 2-6 ParallaxNode2D’s at varying Scroll Scales. Some of them are just simple images, but the boxes are set to repeat and autoscroll, giving the feeling of a factory in motion.
The project is set up to have individual scenes as “Rooms” that get stitched together into a “Level” as depicted below. Here we can see the above room on the far left, and two additional rooms adjoining it to its right. It’s set up this way to make changes to the level’s overall structure quick and easy, and to be able to quickly test an individual room by itself without any of the overhead getting in the way. As such, the Parallax2D’s are stored inside the Rooms.
If you’re familiar with Parallax2D’s you’ve probably already spotted the issue. A Parallax2D node would visually look fine when testing the individual room, but break as soon as you place it into a level due to the positioning of the room in world space.
for p in e_parallaxLayers:
p.scroll_offset = Vector2(global_position.x * (p.scroll_scale.x - 1), global_position.y * (p.scroll_scale.y - 1))
Thankfully it’s easy enough to fix with a little bit of reverse engineering on how the scroll_scale works. When a Room is entered, manually set the scroll_offset of the Parallax2D to a value based on where the Room is inside the Level.
This reveals, however, the real problem I’m having: This solution only works for Parallax2D’s that aren’t set to auto-scroll. Above is the third room in the sequence (with a portion of the bg cut out so you can see better), with the moving boxes AWOL.
When autoscroll is set up, the Scroll Offset is constantly being overwritten (even though it says it “will not be overwritten” which confuses me) by the auto-scroll system.
Is there an out-of-box solution to this using the existing Parallax2D functionality, or should I instead be looking at other solutions?
Off the top of my head I could probably just whip up a simple texture-repeat shader that offsets itself, or even just animate the belt, but I wanted to ask for help because it sort of seems like a bug based on the documentation? Or maybe my understanding of the node is simply just wrong, it’s hard for me to say? Regardless I’d appreciate any help with the problem. Thanks!


