Skip to content

Instantly share code, notes, and snippets.

@mohapsat
Created July 29, 2018 18:46
Show Gist options
  • Save mohapsat/9d634f66f8b82dcb928b7022bb103e69 to your computer and use it in GitHub Desktop.
Save mohapsat/9d634f66f8b82dcb928b7022bb103e69 to your computer and use it in GitHub Desktop.
ParallaxBg_Godot3
To get that ParallaxBackground working:
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 (in the case of the Sky sprite, 640x640).
6. Under Motion, fiddle with the Scale setting. This is how fast that ParallaxLayer will move in relation to the camera. I found (0.1, 0.1) to 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.
- and on smaller skies, you can set the flag: repeat, set region enabled and set up the region values for a repeating sky...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment