Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: rigmarole on March 22, 2015, 09:10:36 AM
-
I'm trying to use unity 5.0.0 with NGUI 3.8.0.
Everything seems to work nicely except....
When I switch my "Camera" under "UI Root" from orthographic to perspective, two things will go wrong.
1)
Once I reopen my project, I receive errors like this:
"Screen position out of view frustum (screen pos 0.000000, 0.000000, 5.005000) (Camera rect 0 0 0 0)"
2)
When I try to make prefabs by draggin game objects into project window,
Many game objects names "UI Root" will appear...
Even if I open a new scene and only create one NGUI sprite in it, same error will occur...
Please help me about it! Thanks...
-
1) Check the settings on your Camera. This isn't NGUI-related.
2) http://www.tasharen.com/forum/index.php?topic=12768.msg57955#msg57955
-
1) Check the settings on your Camera. This isn't NGUI-related.
It's easy to reproduce...
1) New Scene
2) Create an arbitrary UIWidget (or UI Sprite). An "UI Root" and a "Camera" will be created automatically.
3) Change the "projection" setting in Camera to "Perspective"
4) Reopen unity project, errors message appears.
The error messages only appeared when there are some NGUI stuffs.
And all of camera's settings are default.
2) http://www.tasharen.com/forum/index.php?topic=12768.msg57955#msg57955
It works! Very thanks~~
Edit: Sorry about that. After some attempting, problem is still there...
-
As I mentioned, check your camera settings. When you create a 3D UI using the NGUI menu it will position the camera correctly and set everything properly. Changing a 2D UI to a 3D UI is more involved than simply altering the camera's field. You also need to set near/far clipping and move it back a bit at the very least.
-
I start a new Project, create a new scene, import NGUI 3.8.0 and use NGUI menu create a 3D UI. (Unity 5.0.0)
Save project and reopen it, error message appears...
I don't think there is anything not set properly. (See the attachment please)
(Actually, all graphics will work properly expect the error message. Those messages are very annoying...)
-
Try turning off occlusion culling on the camera.
-
I tried, but same problem... :(
== Edit ==
The problem is happened to the static function "GetWorldCorners" in NGUITools.cs
Inside, when I choose perspective camera, it calls the "ViewportToWorldPoint" of delivered camera.
I've check basic parameters of that camera, all of them seems to be correct.
But when I try to use "ViewportToWorldPoint" and "WorldToViewportPiont" at this moment, these two method are broken!
I guess the inner variables are not fully initialized at that moment...
It only happened when I just start the editor.
-
One of many oddities in Unity 5 I suppose.