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
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
- Profiling information icon does not update for Light Mode
- [Linux] Type to select functionality is missing for drop down menus
- TextMeshPro calculates Width Compression incorrectly when using certain values in the WD% field
- VFX Graph link contrasts fail WCAG guidelines
- D3D12 PSO disk cache feature crashes if paths contain non-ASCII characters
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/