I am trying to make my first game (i have zero experience but i will do it anyway) and probably i have watched more than 5 videos for Parallax background but everytime it doesn’t work properly.
They introduced a new node Parallax2D, that is the recommend over the older nodes. Potentially watching multiple tutorial videos is confusing things as they may be using different nodes.
I think the problem is my background images are 320x180 but my viewport is 1152x648
If I set my viewport 320x180 it works fine but then it is too small to see or play. Like i said before i don’t know so much about coding so how resolution works i don’t know. But i want to learn…
Also my camera zoom is “4” maybe this could be a problem as well…
Both your scroll scales are set to 0. It looks like you want to move in the x-direction, so set your scroll_scale x to 1 to move at the same speed as the viewport, less than 1 (0.8 say) to scroll slower than the viewport (looks like it is further away like a background) or higher than 1 (1.2 say) to scroll faster than the viewport (looks nearer to the camera like a foreground).
Don’t give up yet! And that is not a solution! Parallax layers are genuinely simple and robust. So something somewhere is breaking and you have not found it yet. But it is not the parallax layer.
Paste your background image here and I will do a simple mock up for you.
Don’t shrink the viewport to 320, that only makes the whole game tiny. Keep 1152×648 (or whatever), and make the art fill the view.
With Camera2D zoom 4, you only see about 1152/4 ≈ 288 world-pixels wide. A 320-wide sprite is barely one screen, so it looks “broken” unless you scale and/or repeat it.
On each Parallax2D (you already have follow_viewport on == good):
Far sky: scroll_scale (0, 0) is fine (doesn’t move)
Other layers: (0.3, 0), (0.5, 0), (0.7, 0) — not all zeros repeat_size.x = texture width (320)
Scale the Sprite2D up (or the Parallax2D) until it covers the zoomed view Parallax2D is the right node for 4.7; ignore old ParallaxBackground tutorials if they fight you.
Each to to their own, but for pixel art games you should absolutely set the viewport to something akin to an equivalent of what would have been a retro resolution.
So for example for 1080p , 384x216, with integer scaling set to 5.
I have solved my problem… The first thing i did was rebuilding the things i have done with my new size settings and camera settings (i have changed zoom, viewport settings etc. and it took half hour because i was still in the beginning)
and here is the result: (i can’t share video i guess so you can’t see clearly but background is moving towards left (with different autoscroll pixels) and looks cool i think… for now…)