Author Topic: 3.5.8 to 3.6.9 upgrade majorly glitches NGUI  (Read 1846 times)

Wisteso

  • Full Member
  • ***
  • Thank You
  • -Given: 21
  • -Receive: 3
  • Posts: 103
    • View Profile
3.5.8 to 3.6.9 upgrade majorly glitches NGUI
« on: August 11, 2014, 10:18:14 PM »
Previously with 3.5.8, my NGUI component was working almost flawlessly. No real hacks in use.

However, upgrading to 3.6.9 has completely glitched the GUI. (Upgrade was done in a blank scene per instructions). Most of my panels are now way out of position in Play Mode, but look fine in Editor Mode before hitting play. Some of the issues I'm having are...

  • Some NGUI components (like UI Root) are positioning themselves in the 'World' camera, when they should be inside the 'UI Root' camera
  • NGUI itself seems to be contradicting itself with what it shows in the inspector and what it renders. E.G. 'UI Root' inspector shows XYZ=20,20,0 yet gets displayed at XYZ=0,0,0.
  • Some elements are just floating around at a location that's parallel to both the 'UI Root' camera and the 'World' camera

It's a mess and I dont see any hint of an idea why this happened in the release notes or documentation. My only idea is that the changes to anchors messed everything up. My GUI uses a ton of anchoring (OnEnable) and a few UIAnchors.

I've attached two screenshots taken from Scene View (since that's where the issue is most obvious). "Play Mode" layers the NGUI camera on top of the World camera, if that's not apparent from the screenshots.
« Last Edit: August 11, 2014, 11:06:16 PM by Wisteso »

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: 3.5.8 to 3.6.9 upgrade majorly glitches NGUI
« Reply #1 on: August 12, 2014, 02:17:07 AM »
If you look in the advanced options on the UIPanels that you're anchoring to, if "Offset" is checked, the position of UIRoot counts. An offset of 20,20 will move your stuff 10 screens away. It works on the global position of the panel. Quick fix is to place UIRoot in 0,0,0.

Also take a look at your layers. NGUI finds its cameras by looking at which layer the widget/camera is in, (FindCameraForLayer), so if you're using default for everything things like this can happen depending on which camera is found first. Move your UI into its own layer (define a new one) and see if the problem persists.