- Home /
Change text color for multiple text elements at once
I have a prefab that contains more than one text elements. I want the background color to change on both when the pointer enters and or clicks. Tried Selectable, but it only works on a single element. Initial thoughts?
Answer by phil_me_up · Feb 03, 2016 at 08:14 PM
Have a manager script which has a reference to all the text elements you want to change in a list / array, then simply loop through them to set the new colour.
Alternately you can have a script on each text element object which periodically checks (or better still, listens for an event from) a manager which then triggers the colour change.
Your answer
![](https://koobas.hobune.stream/wayback/20220612062905im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
UI Text.color not assigning? 2 Answers
Animated Colorization of UITextMeshPro,Animated vertex color text mesh pro 1 Answer
Multiple Cars not working 1 Answer
UI text color not assigning correctly 2 Answers