Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by MiguelDeLaCruz · May 05, 2011 at 08:21 PM · cameraeditorsceneview

Editor Camera Orthograpric Control

The camera component has a boolean called orthographic. It is used to either have the camera be in perspective or orthographic mode. I'm attempting to change this bool during editor mode, not during runtime. And we know that we can somewhat access the editor's scene view camera via Camera.current or SceneView.lastActiveSceneView. So far we can access and set, the camera's rotation like this: SceneView.lastActiveSceneView.rotation = Quaternion(...), and the position like this: SceneView.lastActiveSceneView.pivot = Vector3(...). However, I don't know how to access the orthographic bool for the life of me. When I access the camera, it is read-only, so current.camera and SceneView.lastActiveSceneView.camera is fail. Does anyone have any insight on this? Thanks ahead of time.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by Bart 2 · May 06, 2011 at 08:07 PM

In the top right corner of the scene view there is a gizmo that shows the three axes of dimensional space. Under it you currently see "Persp", which means your scene view camera is in perspective. If you click on any of the cones in the gizmo, the camera will switch rotate to look from that direction and it will switch from "Persp" to "Iso", short for "Isometric" which is an orthographic projection. You can hold and drag the right mouse button to change the orthographic view's direction, and you can click on the cube at the center of the gizmo to return to "Persp".

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jpthek9 · Feb 28, 2014 at 02:14 PM 0
Share

Thanks a lot! The other answer got it all wrong and just confused me more.

avatar image
2

Answer by Alexphauge · Nov 27, 2014 at 02:41 PM

This is waaaay too late to answer now, but in case anyone else might need it, it's "just"

 SceneView.lastActiveSceneView.orthographic = boolYouNeed;
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by KatsuomiK · Jan 28, 2015 at 08:16 PM

This might be a complete example.

 using UnityEngine;
 using UnityEditor;
 
 public class SceneViewNavigation : MonoBehaviour
 {
     [MenuItem("Navigation/Top View")]
     static void TopView()
     {
         SceneView.lastActiveSceneView.rotation = Quaternion.Euler(90f, 0f, 0f);
         SceneView.lastActiveSceneView.pivot = new Vector3(0f, 0f, 0f);
         SceneView.lastActiveSceneView.size = 10f; // unit
         SceneView.lastActiveSceneView.orthographic = true; // or false
     }
 }
 
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image idbrii · Mar 27, 2018 at 11:33 PM 0
Share

Using AlignViewToObject seems to set the zoom level as expected better than modifying the pivot.

avatar image
1

Answer by Rodiaz89 · Jun 24, 2015 at 01:32 AM

Here is an asset I made that saves camera views and also if it's orthographic or in 2d mode, it's pretty simple to use and it comes with the source code: https://www.assetstore.unity3d.com/en/#!/content/39370

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jpthek9 · Jun 24, 2015 at 01:34 AM 0
Share

Recommended: Change the price to a whole dollar price.

avatar image Rodiaz89 · Jun 24, 2015 at 01:36 AM 0
Share

Thanks for the feedback, I will do it in the next update :) 1 more cent for me! hahaha, but no worries I get why you said it.

avatar image
0

Answer by Henrique Vilela · May 05, 2011 at 08:29 PM

Camera.main.orthographic = true;

Source: http://unity3d.com/support/documentation/ScriptReference/Camera-orthographic.html

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MiguelDeLaCruz · May 05, 2011 at 08:33 PM 0
Share

Dang, I should have been more descriptive, I meant the editor scene camera, let me edit my question (hits forehead)

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Setting the SceneView View Angle/Position? 1 Answer

Unity Scene View's right-click + WASD doesn't look 3D anymore? 2 Answers

Problem accessing the scene camera 1 Answer

Modify SceneCamera's position in script? 2 Answers

Drawing Handles 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges