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
- Redoing creation of Sub Scenes and Cube GameObjects in Hierarchy throws “Assertion failed on expression: 'targetScene != nullptr’” error in Console window
- Selecting “New Sub Scene” after assigning “New Scene” in Sub Scene Script Component throws “Destroying GameObjects immediately is not permitted” in the Console window
- Shader Graph "Zoom Step Size" can be set to 0 even though the zoom still works
- Enabling/Disabling the Deprecated Nodes doesn't apply to the opened Shader Graph unless any Variable is added to the Blackboard
- Group Selection title text size is smaller in renaming than the actual font size
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/