How to make a BG follow the player only on the x?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kavi
:warning: Old Version Published before Godot 3 was released.

Any idea on how to make a BG follow the player on from side to side, not up and down?

I wan’t it to automatically follow the player (not from when I move left to write with controls). Only Left to Write, NOT Up & Down

Some help and ideas would be nice, thanks.
-Me

you mean the background will only move when your player move ?

Phil88n | 2017-06-20 05:01

do this for the BG: set_pos(Vector2(yourplayernode.getX(), yourplayernode.getY()))

Phil88n | 2017-06-20 05:02

@Phil88n you are setting both X and Y, that won’t work as intented. That will actually stick the background behind the player and not make it scroll at all.

Zylann | 2017-06-20 12:55

:bust_in_silhouette: Reply From: Zylann

The platformer demo does this, its background only moves horizontally and not vertically.
If you are using ParallaxBackground, try to set Base Scale Y to zero?