Mario bros screen

I want to make simple game like mario bros NES: Mario Bros. - Wikipedia.

I don’t want to allow screen show outside of level and make character loops whenever they reach out of bounding area (they will spawn at right screen if they go outside left and vice versa). Any ideas?

    //two empty gameobjects as borders
    public Transform leftBorder, rightBorder;

    private void Update()
    {
        if (transform.position.x < leftBorder.transform.position.x)
        {
            transform.position = new Vector2(rightBorder.transform.position.x, transform.position.y);
        }

        if(transform.position.x > rightBorder.transform.position.x)
        {
            transform.position = new Vector2(leftBorder.transform.position.x, transform.position.y);
        }
    }

as simple as that? I thought it will be more complex like “globe” scrolling. Anyway I still have no clue with the screen…