Author Topic: FindCameraForLayer broken?  (Read 3689 times)

cygnus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
FindCameraForLayer broken?
« on: September 23, 2012, 12:09:06 PM »
Hi,

I'm having 2 cameras within my screen: the main camera for 3D on layer Default and the one for UI on UILayer. I have also a label on the UILayer and within a script attached on that label I'm calling the FindCameraForLayer(gameObject.layer) to fetch me the UICamera. However I notice the MainCamera is returned iso the UICamera.
Something I missed?

I'm using NGUI 2.2.0 on Unity 4 beta 7.

Thanks for getting back to me,

Wim

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: FindCameraForLayer broken?
« Reply #1 on: September 23, 2012, 05:52:26 PM »
Sounds like your main camera is able to see your UI, which is a bug on your part. Double-check its culling mask.

cygnus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: FindCameraForLayer broken?
« Reply #2 on: September 24, 2012, 12:26:16 PM »
You are indeed correct sire! Forgot to alter my culling mask of the 3d camera.