Camera Smooth Follow

3327-camera.jpgHi
I have a problem with camera follow script. My scene is a “room”. It’s 3d iOs side Scroller. My character is starting to walk a long the room, but when I’am using camera follow script from Standard Assets user can see what is out side to room. I need camera to start follow when character is in the middle of iPhone screen and then when the room end’s stop follow.
What I should use? I was playing with offset but I need two different offsets. One from the beginning and another when room is going to the end. So maybe I need two collider’s and when character trigger collider camera starts or stops follow him.
How to make this follow but only in specific borders. I 'don’t want to show what is outside the room.

decrease the clipping planes in camera… decrease the ‘Far’ value until your camera shows only your room

You can use Mathf.Clamp to clamp the position of your camera. Say you want to move your camera from -100 to 100 on the x-axis the code could look something like this (c#, not testet):

    void Update()
    {
        Vector3 vec3 = transform.position;
        vec3.x = Mathf.Clamp(vec3.x, -100, 100);
        transform.position = vec3;
    }