I have a Button - TextMeshPro using Sprite Swap, and I wanted behavior where when the button is selected or hovered, an icon would appear next to it, like this.
I did this by having two images, a blank one for the regular states, and one with the icon in it. Here’s the images.
As you can see, the top one is quite literally a blank png, I don’t think that part is related, but I included it anyways.
When I hover the mouse over the button, the icon appears fine, but if I move from the icon to over the text, it stops being registered as hovered. Does anyone know why this is happening, and how to fix it?
If you can’t update to 2021.3.6 or 2021.3.7 (both of which have buggy nested canvases), there is relatively simple workaround. Disable raycast target property for all the child Images and Text elements, leave it enabled only for top element of the button. In case of TextMeshPro components raycast target property is hidden under advanced properties or something like that (don’t remember the exact names).
Thanks for the response! I am on version 2021.3.0f1. Your workaround seems to have worked! Some easy solution I didn’t have the brain power at the time to process. Still giving you brownie points.