Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 /
This question was closed Oct 27, 2015 at 01:40 PM by arcifus for the following reason:

This was a bug and has been reported to Unity. The tracking number is in the comments.

avatar image
0
Question by arcifus · Oct 23, 2015 at 12:25 PM · editor-scriptingeditorwindowscenevieweditor extensiononscenegui

Why does the SceneView camera return jittery values?

I'm creating an editor extension that relies on converting screen space coordinates into world space coordinates using the SceneView editor camera.

However, doing a simple test of retrieving the camera size or converting coordinates, returns unreliable jittery values.

If you run the script below (place it in an Editor folder and then Window -> JitterTest) and simply click around on the Scene View you will see at least two different values output, even though the SceneView camera is not being moved around. Is this a bug?

*Using Unity 5.2.1f1 (Mac)

alt text

 using UnityEngine;
 using UnityEditor;
 
 public class JitterTest : EditorWindow {
 
     [MenuItem ( "Window/JitterTest" )]
     static void OpenWindow() {
         EditorWindow.GetWindow( typeof( JitterTest ) );
     }
 
     void OnEnable() {
         SceneView.onSceneGUIDelegate += OnSceneGUI;
     }
 
     void OnSceneGUI( SceneView sceneView ) {
         Debug.Log( "Random size:" + sceneView.camera.orthographicSize );
 
         Vector3 testVec = new Vector3( 100f, 100f, 0f );
         Debug.Log( "Random world point:" + sceneView.camera.ScreenToWorldPoint( testVec ) );
     }
 }


testscript.zip (1.5 kB)
output.png (30.6 kB)
Comment
Add comment · Show 3
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 arcifus · Oct 26, 2015 at 05:58 AM 0
Share

I've submitted this as a bug. If I get any confirmation that this is indeed a bug, I will update here.

avatar image saschandroid arcifus · Oct 26, 2015 at 07:45 AM 0
Share

I only get two different values if the scene view is in 2D mode. In 3D it's always the same output.

avatar image arcifus · Oct 27, 2015 at 01:37 PM 0
Share

Confirmed as a bug. You can track it here: https://fogbugz.unity3d.com/default.asp?739443_m5seomjm53bji4mp

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Is there any way to make a timeline feature in editor scripting? 1 Answer

Editor GUI text becoming misaligned 0 Answers

Creating a custom editor window with a grid 1 Answer

Error: Unable to load the icon: 'CustomEditorWindow'. (Custom Scene View) 1 Answer

Accessing OnSceneGUI with EditorWindow in JS 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