Add a Node2D as a child of the camera and set its ordering z index to -1, then save it as its own scene named background and open it.
Add a parallax 2d node for each background layer, then populate each layer with sprites and animated sprites to draw the background layers.
When using pixel art, set the texture filter to nearest.
For sprites that are meant to wrap, set the repeat size to the size of the image. Other individual images can use any number larger than their size depending on how often you want them to repeat.
Give each layer a different auto scroll speed, with layers farthest away scrolling slower and closer layers scrolling faster. You may not want layer 0 to scroll at all.
Set repeat to 2 so there is a copy of each layer both before and after. Make sure that individual images are repeated at least 1 screen width on both sides to prevent sudden disappearances.
Turn on ignore camera scroll for each layer.
Some images may need to be shifted off center.
Return to the main scene and set the ordering z index of the background to -1.
Now the background will scroll automatically giving the illusion of an infinite horizon.
Patreon: / tyanuziello
Discord: / discord
Udemy
https://www.udemy.com/course/build-a-...
https://www.udemy.com/course/godot-ma...
Skillshare
https://www.skillshare.com/en/r/profi...
3D assets made by PixelFrog
https://pixelfrog-assets.itch.io/trea...