Unity 2017.1 p4 - Unity Screen-space camera canvas - Graphics Raycaster fails
Hello there.
Recently upgraded from Unity 5.5.1.f1 to Unity 2017.1p4. Popups in our game which are drawn on a screen-space camera canvas now don't respond to any input.
I've forked the latest GraphicsRaycaster code from bitbucket(5.6) and ran with that so I could debug it. The line it fails on is: if(!RectTransformUtility.RectangleContainsScreenPoint(graphic.rectTransform, pointerPosition, eventCamera)) continue;
Has there been any recent changes to that function which would break previous versions? It points to native code so sadly I can't see what it's actually doing, but with a name like that, I don't see how it could fail to do what it says.
The only thing I can think of, is as the UI that doesn't respond is instantiated, maybe the canvas elements transforms are not being properly re-calculated? (They look fine when inspecting the graphic.rectTransform property).
I've made no other changes other than the upgrade, has there been any similar problems reported post 5.5.1f1?
Thanks
Disabling the "In" animation on the popups has made it work. I assume 2017 is not doing something a previous version did, or is doing it less often for efficiency. I'll try a couple things out to make it work with the animations
Answer by akillingbeck · Aug 22, 2017 at 12:52 PM
Ok I found the error. Unity 5.5.1f1 seemed to be ok with a z scale of 0 for this calculation. Newer versions are not.
I modified our animations to make Z scale 1 and it works.
Your answer
Follow this Question
Related Questions
Updated with UI text element not correct (same frame) 0 Answers
rect transform, dont chance with the new version 5.3.4? 0 Answers
Help! Animating hogs my Pos Y. 0 Answers
Canvas Inventory closing 0 Answers