How to do an automatic scroll level in a 2D mobile game like in mario's game ?

Hi i just would like help for my project, I’m want to make an little game for android, I would like to know how to do an automatic scolling level like mario ( Evolution of Auto Scrolling Levels in Super Mario Games (1988 - 2018) - YouTube )
and if possible, an scrolling level which the camera goes from up to down. Thanks for helping me.

Just add this script to your main camera:

public float speed; //adjust this in the inspector to make the scroll speed less or more

void Update(){

transform.Translate( 0, -speed, 0);


thanks you very much.

hi @highpockets
i used the script you gave me for my game it works very well, but now i have another problem i can’t slove. when i give the scipt to a object, and when I rotate the object that contains your script, the object take another direction and does not go up to down as it should do.

(i decided to make object fall down in the players screen rather than make the play and the background go up because of a script who block me in order to not go out of the screen, i let you an image if intersted )

yeah that is what i wanted and you helped me again, thanks you ! again