Hi All,
I have been trying to debug a problem I’m having in the last few days with no success. I assume the bug is somewhere in my code and not in the unity library and I’m looking for tips and things to try.
I have a prefab 3D object that has a hidden Canvas with a dropbox inside that canvas.
If the player clicks on that object and press the edit button (part of my game mechanism, not related to the problem) → I take the canvas and using SetParent() on it’s transform changes the parent to a different Canvas.
When the player clicks on the dropdown arrow, the dropdown doesn’t show any option, it stops responding and every other UI element stops responding.
If I delete the dropdown list (during gameplay, from the project browser) that is generated from the template, it starts reacting again, but once opening it still has the same bad behavior.
Any idea why it happens? What can I try?
Thanks,
Shay
Some images to show the issue:
- Imgur: The magic of the Internet → before showing the Canvas and UI elements
- Imgur: The magic of the Internet → User selected the game object and pressed the edit button → Canvas and UI are shown
- Imgur: The magic of the Internet → User press the arrow on the dropdown and the issue appear.
What version of unity are you running? Something very similar to this was fixed in 5.6.0 Patch 3.
I’m using 5.6.1f1 personal. I updated today (previous version was updated about a month ago). The issue still exists.
One thing to check is your test case. The issue before dealt with NaN in the transform values of scroll rect and/or it’s viewport/content target. If it’s the same test case I would check your gameobject and zero out any NaN’s leftover pre-patch. Otherwise you may have to file a new bug report.
Thanks, that solved it. The scrollbar value had an NaN. I noticed that before and suspected that’s the issue, but couldn’t debug it. I had to re-create the prefab with a new dropdown to fix the issue.
BTW, I was searching the release note yesterday when I downloaded the new Unity release to see if indeed there was a bug in the dropdown and could not see a note about that…
In any case, issue solved 
Thanks,
Shay
Glad it helped! The bug was in the release notes, but it came out before in 5.6.0p3 or p4