Hello Guest

Author Topic: Avoid UI elements moving with Main Camera  (Read 3036 times)

TheDreamMaster

  • Newbie
  • *
  • Posts: 8
    • View Profile
Avoid UI elements moving with Main Camera
« on: November 30, 2013, 08:20:56 pm »
Hi,

I am new to 2D toolkit, so bear with me :)

I have 3 cameras:

Main: perspective, game objects
Minimap: ortho wide view of playing field
UI: tk2dUICamera

When I place UI elements in my hierarchy, they show up properly, but they only react if I have the tk2dUI script attached to my main camera, they seem to ignore the UI camera (which has a tk2DUI script attached).

Is there a way to fix it?
« Last Edit: November 30, 2013, 08:48:11 pm by TheDreamMaster »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Avoid UI elements moving with Main Camera
« Reply #1 on: December 01, 2013, 12:10:53 pm »
You will need to use unity layers to make sure the Main Camera can't see the UI, and only the UI camera can only see the UI. The UICamera script uses these layers to determine what can be clicked through which camera.