Scrolling effect in 2D platformer game

Hello everybody,

I have a simple 2D platformer game. Camera smoothly follows the player. Then at the background I have a layer with clouds. What I want is when my player moves on the X axis I want to move the cloud layer too but with slower speed only on X axis. How should I do it? I have a script on my player. Thanks a lot.

I would try to make a variable that adds up a X amount when you walk, lets say for example, right.

So when you walk right: var cloudSpeed++
In the script where you control the clouds, make a public gameObject for the clouds.

Then: cloudObject.transform.translate.position.x + cloudSpeed

Then reset the cloudSpeed when he stops, this way when the player stops walking the clouds will go with their original given speed.

NOTE: I am a student, I am trying to help. Please correct me if I am wrong!