Changing the color of the correct answer button sprite

Hello, I was wondering if it’s not complicated how can I change the color of the correct answer button sprite since it’s base color is orange? For the default answer button being blue I can simply change it in the Image compononent of the button within Unity. I can’t do this with the correct answer button so I would assume this would have to be done in code? Would this be difficult to do, or would there be a way to do it in Unity? Obviously this is very minor and presumably when creating games in the future one would simply make the sprite the color desired from the get go but thought I’d ask anyway. Thanks!

Hi,

It is relatively easy to change the colour. Look the name of the component up in the API, for example, if you used an Image component, you look up the Image class. In many cases, there are code examples. You have the knowledge you need to be able to realise your idea. :slight_smile:

It might be, though, that you’ll encounter a little problem: When you change the colours via code, you are getting the “wrong” colour. The reason for this is that the color field does not apply a solid colour but a tint. The solution is simple: Use a white image/texture/sprite.

Good luck!


See also:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms