Search Issue Tracker
Won't Fix
Votes
1
Found in
5.6.1f1
Issue ID
914014
Regression
No
Image.alphaHitTestMinimumThreshold not always registers correct raycasts when set to 1.0f
To reproduce:
1. Open attached Unity project "AlphaHitTestProject.zip"
2. Open scene "testScene"
3. Go into play mode
4. Click on different places of "foregroundImage"
5. Observe the Console Window
Expected result: According to documentation, Image.alphaHitTestMinimumThreshold's value set to 1 would cause only fully opaque pixels to register raycast events on the Image. In other words, clicking on transparent (red colored) parts of the foregroundImage should result in BACKGROUND HIT console output and clicking on the opaque part (blue colored) should result in FOREGROUND HIT console output
Actual result: Clicking on most of the opaque space results in BACKGROUND HIT console output and clicking on some transparent space results in FOREGROUND HIT console output
Reproduced on: 5.5.3p3, 5.6.1p1, 2017.1.0b6
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
FunRobDev
Jul 21, 2017 06:11
Hi all, I found a solution, read my workaround here, which is also a kind of explanation for the coordinate shifting:
https://forum.unity3d.com/threads/image-alphahittestminimumthreshold-not-working-correctly.465586/
ariesdev
Jun 20, 2017 11:54
Hi,
I don't know if it's related to the same issue, but alphaHitTestMinimumThreshold seems to not work properly, as if tested coordinates are shifted. Someone even succeeded to make it work by setting opaque pixels in bottom/left and top/left corner of original image (?).
More information on this post (especially on the end) : https://forum.unity3d.com/threads/image-alphahittestminimumthreshold-not-working-correctly.465586/