Author Topic: DontDestroyOnLoad Collider problem  (Read 3447 times)

Sinner

  • Guest
DontDestroyOnLoad Collider problem
« on: November 29, 2012, 08:32:43 AM »
Hello, i have the following problem:

Reproduction steps:
- Create a new Scene, create a new Gui.
- Make some buttons.
- Make some more buttons, position them to interfere with the buttons you previously created, put them in front (either depth or z value) and disable them.
- Create a script for the UIRoot that calls DontDestroyOnLoad( .. ) on Awake.
- Create a second scene
- Create a method in your UIRoot script that changes to the new Scene - call it from one of the buttons.

Now if you start this example, as long as you are in your first Scene, everything works fine. As soon as you change to the second Scene, you get problems hoovering/clicking your buttons, because for some reason the invisible buttons are interfering you visible buttons.

Anyone have any ideas why it is this way and how to solve this?
I'm using Unity 3.5.6 + NGUI 2.2.6

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: DontDestroyOnLoad Collider problem
« Reply #1 on: November 29, 2012, 08:39:22 AM »
If that's really what's happening then I suggest you create a simple reproduceable case that doesn't use NGUI, and submit it to Unity as a bug.

The reason I say "doesn't use NGUI" is because NGUI simply uses raycasts to determine what's hit. Disabled objects shouldn't be hit, obviously.

shallwaycn

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: DontDestroyOnLoad Collider problem
« Reply #2 on: December 25, 2012, 08:22:43 AM »
HI,
I have encountered this problem today, and I solved it by removing the RigidBody of the UI Root.
don't know why. hope somebody can figure it out:)