- Home /
 
              This question was 
             closed Nov 22, 2013 at 03:42 PM by 
             sotirosn for the following reason: 
             
 
            Unity 4.3 2D view is the answer to this.
 
               Question by 
               sotirosn · Nov 15, 2013 at 12:51 AM · 
                camerascene vieworthographichud  
              
 
              Align scene view camera to HUD camera?
I am trying the following code..
 [MenuItem("GameObject/Align View to HUD")]
 static void AlignViewToHUD() {
     SceneView view = SceneView.lastActiveSceneView;
     if(!view) {
         Debug.Log ("No view found to align.");
         return;
     }
     
     Camera HUD = GameObject.Find("HUD").camera;
     if(!HUD) {
         Debug.Log ("No HUD found to align to.");
         return;
     }
     view.AlignViewToObject(HUD.transform);
     view.orthographic = HUD.orthographic;
     view.size = HUD.orthographicSize;
 }
 
               And it works except that the orthographic size does not translate properly. Shouldn't the above code make the scene view look just like my in game HUD orthograpic camera? I set the HUD orthographic camera size to Screen.height/2, but this is much zoomed in on my scene view. Does anyone know how I could make the scene view replicate the in game camera?
               Comment