- Home /
Draw Camera to Editor Window
Hello Unity friends,
I am having trouble drawing a camera to an Editor window and was wondering if anyone could give me some help. I am currently using Handles.DrawCamera but the position argument also changes the viewport (which I do not want to do). Is there a way to position the camera's render without changing its viewport with the Free version of Unity?
Thank you in advance!
So the issue is that modifications made to the SceneView camera affect both the SceneView and Editor Window, where you only wish to modify the Editor Window's view of the scene?
When I open the Editor window I pass a newly created camera to the Handles.DrawCamera method as the camera parameter. The problem I am having is that I can't position the camera on the Editor window in its OnGUI method. When I pass different Rects into the position parameter of Handles.DrawCamera it changes the cameras viewport and not its position in OnGUI.
Ah, I see. Can you wrap the Handles.DrawCamera call in a GUI.BeginGroup() block?
Just tried it to no avail. The x position is correct but if I try to move its y position down it just scales it.
Answer by yeagz7 · Nov 12, 2013 at 06:17 AM
Holy crap I solved it. I need to have the Game View hidden. If anyone could explain this to me I would be eternally grateful.
This might have something to do with the camera setting itself to Camera.current after assignment. Or are you already accounting for that?