- Home /
Buttons stopped working after I temporarily changed the font.
I'm using Unity2D and I have a pause menu with a couple of buttons. They were working perfectly until I decided to try out a new font. I saw that the font made the buttons stop working so I changed it back but the buttons still don't work. The colors don't even change when I highlight the button. I checked the EventSystem and saw that it didn't recognize that my mouse was over the button but it does for the identical buttons in other scenes. Since I changed the font, do I have to reassign anything? I am very confused.
Answer by octav88 · Mar 12, 2021 at 05:36 PM
Did you change the font on the button themselves, or did you change the font in the entire project? If the colours don't change when you highlight the button and the EventSystem doesn't recognize the buttons it might be that you are missing/disabling the button component from your objects. Can you post a screenshot of what it says on the button's inspector window?
I changed the font of the button through the child text element for the button. When I did that, the inspector window for the actual button didn't change at all. I'm pretty sure that everything is set to the correct properties because it has the same exact properties as the buttons from other scenes that do work. Did I miss something? I attached screenshots of the inspector of both the button and text. Thank you.
For the Target Graphic, drag in the button game object, or at least the Image component of the button, as it seems that currently, you are changing the colour of the text when highlighting.
Functionality wise, I am not sure why it is not working, the script looks completely in place. Do you get anything if you insert a debug.log in your scripts?
Also, if you create a fresh button, does that one work?
I can suggest looking up some sort of version control to avoid even bigger issues like this in the future.