Parallax background issue

Godot Version

4.4.1

Question

Hello everyone, I’m having an issue with a A parallax background on a 2D side scroller project I’m working on. Essentially, 2 of the layers are working as intended but the 3rd one is not. Here’s the setup:

I have a background scene which is instantiated on the main scene from where I run the game. The background scene is structured as follows:

Root node = Node (not Node2D)
CanvasLayerNode → ColorRectNode (children) (This is the sky)
Node2D with the following children

  • ParallaxNode2D → Sprite2D (This is the Moon)
  • ParallaxNode2D → TileMapLayer (Mountains as far background)
  • ParallaxNode2D → TileMapLayer (Mushroom Forest as closer background)

Both TileMap Layers adjust to the Camera view however, the Sprite2D (Moon) does not. I tried to manually adjust the Sprite2D (Moon) but it never appears on the viewport. I added a CanvasLayer as a parent of the Sprite2D (Moon) and this works but the Layering orders breaks, so even if I change the Z-index to -100 the Sprite2D (Moon) draws on top of everything else.

Does any of you great and amazing people out there have an idea of what might be happening here and how to fix it?

Thank you all in advance.

Here’s a clip to visually see what’s happening: https://youtu.be/nqPP-YPzA8I

I found the solution. Here it is in case someone goes through something like this.

I added a CanvasLayer Node as the Parent of the Sprite2D (Moon). Then with the CanvasLayer selected on the right hand side “Inspector tab” Select Layers and give it a value of something like -100. It works beautifully.

Thanks again to those of you who at least saw this post and I hope it helps anyone who might be going through the same challenge.

1 Like