Author Topic: 2d UI and 3d buttons?  (Read 1738 times)

itszander

  • Guest
2d UI and 3d buttons?
« on: November 16, 2012, 03:05:02 PM »
Hello,

I have a quick question. I have a  2d UI that has a camera set to orthographic. The UI works perfectly.
I have created a 3d object and want to use it as a button. I applied UIbutton, UIoffset, UIscale, and UIsound to the 3d object.

When the layer of the 3d object is set to default then the button does not work.
When the layer of the 3d object is set to the forefround UI layer, then the button works.

But, the problem is that the foreground 2d layer is orthographic so that the 3d object becomes 2d.

Is there a workaround?

Thanks.

-zander

itszander

  • Guest
Re: 2d UI and 3d buttons?
« Reply #1 on: November 16, 2012, 03:45:44 PM »
solved?

I attached a UIcamera  script to the 3d camera in the scene.

Is this a bad idea? It works.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 2d UI and 3d buttons?
« Reply #2 on: November 16, 2012, 05:32:47 PM »
Yeah, that's correct. UICamera should be attached to every camera that will see objects that should respond to events.