The interactable part of my button is random and do not respect the alpha setting
Hi guys,
I am working on an interactable map for a game project but I have some trouble while using transparent images.
I created two sprites, one with only the outline and the name of the location and one that shows a picture to represent the location. I wanted the sprite to change when the mouse is over the sprite. I used a script to define the alphaHitTestMinimumThreshold and it works but the interactable area of the button is... well random for what I see. It doesn't respect nor the first sprite, nor the second one.
Here is a picture to show you the two sprites and the area that works.
This bug occurs on all the location and the interactable is different each time.
I enabled read≀ite on all the sprites, I disabled atlassing and I put that script to enable alpha transparency :
GetComponent<Image>().alphaHitTestMinimumThreshold = 0.5f;
Thank you for your help !
Your answer
Follow this Question
Related Questions
Changing sprite alpha on all prefab clones 0 Answers
Glowing 2D items 0 Answers
click the button to change the character's sprite 1 Answer
Transparent Sprites Android 0 Answers