field of view

how can i say to the player that don’t get out of the screen(camera field of view)?
my player and camera always are moving forward and when i controlling the player,it’s get out of screen.

one simple way is to have transparent barriers attached to the camera, so when the camera moves they move too.

The genre of game is top down plane shooter. My camera and player are moving forward with a constant speed. Also player can controll the character and move it. I want to say to player that dont get out of the screen. If i attach the character to camera,then if i move the character in axis of left and right,camera will move too. But i dont want to .also my game is not top down completely. It’s a bit perspective. The script code for player is below:

#region default
using UnityEngine;
using System.Collections;

public class Plane_Controller : MonoBehaviour {

// Use this for initialization
void Start () {
}
float x_position=0;

float z_position=0;

public Rigidbody Bullet;

public int i=5;

#endregionc

//----Set to the Plane----

// Update is called once per frame

void Update ()

{

transform.Translate (0,0,10*Time.deltaTime);

#region positioning

//----D----

if(Input.GetKey(KeyCode.D))

 {

     if (this.transform.position.x < GameObject.FindGameObjectWithTag("MainCamera").transform.position.x+40 ){

           x_position=1;

            transform.position+=

             new Vector3(x_position*Time.deltaTime*8,0,0);

             //Rotate Right

             transform.localRotation = Quaternion.Euler(0,0,-30);

           }

   }

//----A----

if(Input.GetKey(KeyCode.A))

       {

            if (this.transform.position.x > GameObject.FindGameObjectWithTag("MainCamera").transform.position.x-40 ){

             x_position=1;

             transform.position-= new Vector3(x_position*Time.deltaTime*8,0,0);

              //Rotate Left

                transform.localRotation = Quaternion.Euler(0,0,30); 

            }

     }

//----S----

   if(Input.GetKey(KeyCode.S))

       {

            if (this.transform.position.z > GameObject.FindGameObjectWithTag("MainCamera").transform.position.z-20 ){

                  z_position=1;

                   transform.position-=

                   new Vector3(0,0,z_position*Time.deltaTime*8);

              }

    }

//----W----

     if(Input.GetKey(KeyCode.W))

        {

              if (this.transform.position.z < GameObject.FindGameObjectWithTag("MainCamera").transform.position.z+20 ){

                     z_position=1;

                     transform.position+=

                      new Vector3(0,0,z_position*Time.deltaTime*8);

                }

        }

       //----Rotate default----

        if(Input.GetKeyUp(KeyCode.A) || Input.GetKeyUp (KeyCode.D)){

              transform.localRotation = Quaternion.Euler(0,0,0);
           } 

           this.transform.position = new Vector3(this.transform.position.x,13,this.transform.position.z);

             #endregion

In other script i say to camera that move forward like player in default. The upper code is not good for my game. Because my game is perspective and upper’s side of screen is my problem. I want a script that can recognize the field of view and force the player to move only inside the field of view.