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
- [Android] Stage information is not logged when Log Shader Compilation is enabled
- [Vulkan] The memory allocation increases rapidly when there are multiple (three or more) Real-Time Reflection Probes in the Scene
- [macOS] Library folder of the opened project can be deleted which leads to the crash
- “Default Scene” dropdown field contains a spelling mistake “Default Builtin”
- Editor crashes on PPtr<Mesh> after adding Text Mesh and Cloth Components to the same GameObject
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/