How do I emulate the parallax background as seen in the 2D Physics Platformer demo?

soundchasersoundchaser Posts: 17Member
edited July 2018 in 2D

Alright, so I've been wondering about this for quite a while now, but do any of you wonderful people have any favorite tutorials or good suggestions for someone struggling to grasp parallax backgrounds?

Specifically, I'm looking to try and create a background similar to the one found in the 2D Platformer demo. I have the sprites/layers in place, the scrolling does happen, and as long as I am moving my character from left to right the background repeats as it is expected to, but if I move lower down in the level, I just see the grey background and whatever is still showing of the sprite based on my position. I'm not at my regular PC at the moment, but once I return to it I will post a picture of what I am referring to.

In the demo, the background is small compared to the rest of the level, but there is never a point where the background is off screen, regardless of the character's x or y position.

Any help, insight, or others who are also bewildered by this are welcome. :smile:


Tags :

Best Answer

  • soundchasersoundchaser Posts: 17
    Accepted Answer

    Ok, so I figured it out! If anybody is watching or even cares, the effect that is used in the demo has to do with the Base Scale vectors in the ParallaxBackground inspector and then in the Scroll section of that menu. In the demo they have the Y vector set to 0, which effectively locks in the background at that level. Solved my own problem and it feels good!

Answers

  • soundchasersoundchaser Posts: 17Member

    The images:
    Here is the top of the level. Where all is well and good.

    Roughly 128 pixels down, we get this.

    Another area for posterity's sake.

  • soundchasersoundchaser Posts: 17Member
    Accepted Answer

    Ok, so I figured it out! If anybody is watching or even cares, the effect that is used in the demo has to do with the Base Scale vectors in the ParallaxBackground inspector and then in the Scroll section of that menu. In the demo they have the Y vector set to 0, which effectively locks in the background at that level. Solved my own problem and it feels good!

  • cowhand214cowhand214 Posts: 16Member
    edited July 2018

    @soundchaser said:
    Ok, so I figured it out! If anybody is watching or even cares, the effect that is used in the demo has to do with the Base Scale vectors in the ParallaxBackground inspector and then in the Scroll section of that menu. In the demo they have the Y vector set to 0, which effectively locks in the background at that level. Solved my own problem and it feels good!

    Thank you for coming back and letting us know what the problem/solution was! I check in on posts like this even if I a.) have no idea how to solve the issue or experience with it and b.) am not doing anything for which this is directly relevant. Mostly because I'm trying to soak up as much info as possible and because you never know when this might be directly or indirectly useful down the road!

    I guess what I'm saying is at least one person cares even if I had no idea how to be of use! Also: congrats on solving the problem. That's always a good feeling.

  • soundchasersoundchaser Posts: 17Member

    Thank you for the reassurance. The Godot community has been incredible based on my experience and I am glad/eager to contribute any way that I can.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file