Parallax backgrounds are visible in the editor but not in the game

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By julkip

I have set up my scene like in this screenshot:
Scene setup
The Player-scene has a Camera2D as a child.

In the editor I can see Sprites from the PalallaxLayers, but when I start the Scene only the Tilemaps and the Player are visible. What am I missing?

:bust_in_silhouette: Reply From: rossunger

You might wanna put your whole parallax system inside a canvasLayer node, so that it’s not affected by the camera… at least as a test.

Without more information it’s hard to know what the issue might be. If you run the game, you can click the “remote” button where the scene tree panel is and it will allow you to play with the runtime tree as it is in the game right now, and you can select each node and see if maybe the position is way off… Or maybe visibility is turned off… Or some other setting.

Interesting… When I inspect the tree with the “remote” button while the game is running I see that the Positions of the ParallaxLayer-Nodes are completely borked… In the editor inspector the position is (0, 0), but in the “remote”-inspector it is (-140, 400). There is no code in my game that would move these nodes.

julkip | 2022-02-11 17:22

It’s probably the camera moving them. Try putting them in a canvas layer… Or playing with the parallax settings on each parallax node

rossunger | 2022-02-11 17:25

Putting the ParallaxBackground-node inside a CanvasLayer-Node does not change anything in the result.
The Camera is just a stock Camera2D with current == true and the left limit set to -100. Otherwise everythin is default. I don’t get why the backgrounds would be moved.

By the way, when I manually move the ParallaxLayer-Nodes by +140, -440 they also dont appear in the correct position where they should be in the editor.

julkip | 2022-02-11 17:47

Oh damn… I just got it. I used very low resolution assets, because it was easier to take those and scale them up by 3 in the engine than to create bigger assets.
I had the scale inherited by the CanvasLayer in ParallaxBackground set to 3 on x and y, this messed everything up.
I just scaled the assets to my project size in an image editor, reset the scale in ParallaxBackground and now everything works as intended.

Still feels like a bug though…

julkip | 2022-02-11 17:57