x


Control Editor Scene Camera

Is it possible to access the Scene's camera? I can't find anything about it in the reference.

What I'd like to do is to set it to "Back" instead of "Perspective" to get isometric/orthographic(or what could be described as most similar to orthographic) view automatically at certain points of editing. This is to make sure our level editors always get the right perspective as our game is 2D.

Impossible, improbable or doable? :-)

more ▼

asked Aug 28 '11 at 12:01 PM

save gravatar image

save
8.2k 22 31 62

(comments are locked)
10|3000 characters needed characters left

2 answers: sort oldest

It's not possible to change the SceneView's camera's perspective. It is, however, already orthonographic by default, so I'm not sure I understand your question.

more ▼

answered Aug 28 '11 at 12:23 PM

Joshua gravatar image

Joshua
6.4k 19 25 71

Ok thanks for clearing that up, not even possible by hack? I'm not very sure what you mean by the camera being orthographic as it doesn't render objects uniformly and has a perspective whilst moving. Switching to left, right, front or back does however render objects without perspective (but render their true size in the perspective). I do feel I get more and more unclear as I go on. :-)

So no go for scene camera controls in Unity, that's good to know!

Aug 28 '11 at 08:56 PM save

Perhaps I'm confusing orthographic with isometric here, the camera should always see everything isometric from a zero degree rotation in front position. But as long as we don't have control over the scene view camera via script it doesn't matter.

How about adding another camera that takes over the scene view?

Aug 30 '11 at 09:21 AM save

Well you surely can fake your own sceneview by creating an Editor Window, not sure how much trouble this would be but it surely can be done.

"Ok thanks for clearing that up, not even possible by hack?"

Nope, not as far as I can tell. I tried messed around with SceneView.lastActiveSceneView.camera, but it seems as soon as you edit anything it gets reset.

Sep 01 '11 at 12:55 AM Joshua

Ok thanks Joshua for the insight and testing. I get pro-shivers when thinking of how constructing our own scene view would build up trouble, it's best to leave it be. :-)

Sep 01 '11 at 12:38 PM save
(comments are locked)
10|3000 characters needed characters left

I'm not sure if the accepted answer is misinformed or just outdated, but it absolutely is possible to programmatically change the scene view camera's projection.

`SceneView.lastActiveSceneView.orthographic = true;`

To set it to a back view

`SceneView.lastActiveSceneView.LookAt(SceneView.lastActiveSceneView.pivot, Quaternion.LookRotation(Vector3.forward));`

more ▼

answered Nov 23 '12 at 09:59 PM

Q*Bert Reynolds gravatar image

Q*Bert Reynolds
1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3014
x1678
x718

asked: Aug 28 '11 at 12:01 PM

Seen: 2505 times

Last Updated: Nov 23 '12 at 09:59 PM