Position camera accurately in the editor

I would like a way to accurately position my camera. In other editors I've been able to do this by setting the current viewport in the editor to what ever the camera sees, and then I can move it using FPS controls.

If that is not possible then what I would like to do, if possible, is to have 2 scene windows up. One is the normal scene editor window, and the other shows me whatever the main camera sees. This way I can move the camera in the first scene and check that it is in the correct position on the second one.

I hope this is possible, and I hope I have made myself clear.


The second idea is very easy - tear off the game or scene tab from the tab bar, and you'll have both views on screen (may require changing your layout to something with both game and scene tabs)

The first one is doable if you don't mind moving your camera to whatever the scene camera sees - use fps controls to move it, then just select your camera and hit GameObject > Align with view

To answer your question(?) (which is phrased like a feature request), you can do this a few different ways:

With no real setup - have a Game view and a Scene view both open and move the camera. The Game view will show what the camera is seeing. Or as Mike said, just use Edit> Align with view.

With minimal setup - same as above, but put your camera control scripts on the camera.

  • Using Play mode: Select the camera in the hierarchy and click the play button at the top of Unity (Ctrl-P) and use your camera controls in the game view to move your camera as you like. Record the settings somehow as the moment you hit the pause button (Ctrl+Shift+P), the camera will be reset. Apply the settings manually.
  • Or In Edit mode: In some camera control scripts, you could try adding the ExecuteInEditMode attribute, but beware as this will likely make your input do double duty as the editor will still be using your input for its existing controls, meaning that using the mousewheel to do something to a camera will move the camera and will also zoom in the scene view if it has focus. You could then turn the scripts on and off as you like.

With more setup - The solution you'd probably want is to create an editor script to allow you to take over a camera (stores your current view settings, sets your viewport to the same settings as the camera and as you change your viewport, have the script change the camera, finally resetting your viewport as you had it originally). This is actually a fairly easy scripting exercise.

Hope one of these meets your needs.

Not explored your issue in depth... just a quick suggestion. drag your game window to be standalone(out of the Unity Editor) and place it and size it as you like. Do the same with your Inspector window. Hit Play, and move around in the game window and witness the scene window moving along, and the Inspector's parameters as well. You probably will have to set up (extra)cameras according to your requirement, and maybe more than one control characters. I am not sure this will help you, but I caught this rapidly and do not have time to do more now.

Hey, you could check my plugin to be able to stream view from editor to game and vise versa.