- Home /
Multi Coloured Buttons
Like stated in the title i want to create a button which changes more than one colour. To be more specific, like in the screenshots shown, i want to recolour the little square in the button when hovered into the colour of the button and vice versa.
This worked by using a script and an empty game object just to ensure the image will be rendered somewhere. So i overlayed 2 images on 1 button.
This is also where the problem came from, since with this second empty object i was forced to make it a raycast target so it started to block the raycast for the button under it. If i turn off the raycast target then it obviously doesnt want me to run the colour changing script of the square.
A second Image component on the button doesnt work at all because unity and moving the empty object on Z Axis behind the button doesnt work too since it still gets hit by the raycast and disables the button no matter if +1 or -1 on the Z Axis.
Anyway images might clear my problem up a bit so : http://imgur.com/a/Xuszz I appreciate any form of time people invest into my problem and look forward to possible solutions.
Your answer
Follow this Question
Related Questions
OnPointerEnter and OnPointerExit not being triggered 0 Answers
SetPixel() for UI Image? 2 Answers