Add Parallax Background to a 2D Game
Add Parallax Background to a 2D Game
1. Create a ParallaxBackground node. (It doesn’t need to be a child of the Camera2D node, but making it a child of the Camera2D node won’t break it either)
2. Create a ParallaxLayer node as a child of the ParallaxBackground.
3. Add your sprite as a child of the ParallaxLayer node and make sure Centered is off.
4. Go back to the ParallaxLayer node.
5. Under Motion, set Mirroring to the size of your sprite (e.g. 640×640).
6. Under Motion, fiddle with the Scale setting. This is how fast that ParallaxLayer will move in relation to the camera. 0.1, 0.1 can be a good starting point for something like a sky.
7. Run your game, and you should have a background that infinitely loops and also has a parallax effect.
Source:
Comment by Michelle M. @ https://youtu.be/uV5WKocIycY