Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Waanders on August 05, 2013, 06:28:51 PM

Title: Camera script attached to Main Camera?
Post by: Waanders on August 05, 2013, 06:28:51 PM
Hi guys, I am a brand new user of this fantastic product, so a real newbie.

So I have project with 2 scenes:
Menu (the main menu)
Scene (the 3d game scene)

I added some Texture Buttons to the Menu scene and they work fine!

I added some Texture Buttons to the Scene scene and they did not work. After browsing the forums and messing around a lot I found a solution.

Solution:

--> for the Scene scene (where the buttons did not work) I checked the UICamera script attached to the Main default camera that was already in my scene. NGUI's UI Root camera does not seem to have an effect.

If i understand correctly, the UICamera script only needs to be enabled with the NGUI camera, right? At least, that's how it works with my Menu scene (that worked from the start).

Please enlighten me, since I would like the project to be clean and efficient without any quick fixes that seem to work.

Thanks!

 
Title: Re: Camera script attached to Main Camera?
Post by: ArenMook on August 05, 2013, 10:57:43 PM
UICamera is what sends out events. As a rule of thumb, if what your camera sees is supposed to receive NGUI events, then it must have a UICamera attached.
Title: Re: Camera script attached to Main Camera?
Post by: Waanders on August 06, 2013, 04:52:11 AM
Thanks for your reply.

So in this case I would attack UICamera to my original camera, and just leave the Root2D -> Camera without the UICamera script? That is the only way that seems to work for me, but I find it a bit confusing, since the UI is rendered through the NGUI Camera.

Title: Re: Camera script attached to Main Camera?
Post by: ArenMook on August 07, 2013, 05:41:23 AM
Assuming you don't want your UI to receive events, yes. If you do, then both should have a UICamera.