Hello,
I am noticing a problem with my worldspace gui’s.
It seems that my UI elements (I have tested this with buttons and text input field) do not have the correct collision bounds in world space. The actual hitbox of the graphic raycast is offset from the button or ui element.
This image should show what I am talking about:
The red debug line shows the direction of the users view (and location of the mouse pointer on the screen). The yellow button with “ECM” written on it is being triggered (yellow is its active state) but the red line is not actually in contact with the button.
This problem occurs with all of my gui’s, in both the editor and the build.
I can’t seem to track down a solution to this. I replaced the built-in graphicraycast script with one that I found on github, but the issue was the same.
With larger gui buttons, the offset is less noticeable, but I need to make some fairly complex gui’s with lots of buttons, which means I need to solve this issue. Does anyone have any ideas?
I am using Unity 5.6.