Changing camera view when hitting collider

Okay i Haven’t much no how on coding but is this possible, i am making a pacman styled game, but instead of the camera been at the side its a top view, okay so basically all i want is that when i enter a collider id switches to a different camera if this is possible will somebody help me or point me in the right direction ??

Thanks

public Camera camer_main;//assign your main camera here
public Camera camer_top;//assign your top camera here

     void Start()
                 {
       camer_main.enabled  = true;//a the start of the game main camera will be enabled
       camer_top.enabled = false;
                 }

      void OnGUI ()
                {

                }

      void OnTriggerEnter(Collider other)
                {
              	
              	if(other.gameObject.name == "Cube")
              	                {
                            camer_main.enabled  = false;
                            camer_top.enabled = true;
                                   }

                }//trigger on enter

}// c#

    var camer_main :  Camera ;//assign your main camera here
     var camer_top :    Camera ;//assign your top camera here

     function Start()
                 {
       camer_main.enabled  = true;//a the start of the game main camera will be enabled
       camer_top.enabled = false;
                 }

      function OnGUI ()
                {

                }

      function OnTriggerEnter(Collider other)
                {
              	
              	if(other.gameObject.name == "Cube")
              	                {
                            camer_main.enabled  = false;
                            camer_top.enabled = true;
                               }

                }//trigger on enter

}// java script

attach the script to the game object which is going to collide with the cube or trigger with the cube and add a rigid body to the game object in the cube check the is Trigger