I can't get my camera to move with my bike

I have a dirtbike game, and it has a parallax background, the background is a child of the main camera.
this is a 2d game btw

so basically, the parallax and bike controls are working. but the second i put a follow script to follow the bike, and run it, the background starts falling infinitely. This is probably because it’s trying to follow the bike which is falling down, how do i fix this. the bike never stops at the ground because the background is falling faster than the bike, so the bike never touches the ground. pls help, i attached my code

You are going to want to detach the background from the main camera because children’s position will follow their parents. Your Hierarchy should look like this:
147959-capture.jpg
Also, you only need the camera to follow the the x position. You can set the cameras other position values to what they are already like this:
147960-capture2.jpg