Change color on text

Im a total noob just playing around in BP trying to learn. In this case I just want to change the color on my textrendercomponent.
The problem is it only works once. And I can clearly see when I press shift that get different values (from the print string) So the text should shift in red tones.

Any ideas?

Hi waxxab,

Did you set up a material instance dynamic? Check out the links below for more information on material instancing:

Nope, no materials or anything, just changing the color with “Set Text Render Color”. This was my next step.
But why does it work once?

Is this text render actor in a separate blueprint from your pawn or player controller? If so, set up a begin play>Enable Input and set the player controller to 0 so you can actually affect it. See if that fixes the error.

Its in a separate BP, but i have already enabled the input on Player 0.
But it works once, the color gets changed, so it kind of works. its when i press a second time nothing happens. And i can see that RandomStream seeds a new value, cos I print it to screen. But the color on the text component is not changing. Of course i can change to use materials, but I want to understand what is happening here.

Hi waxxab,

I was able to reproduce this and can confirm that it is a bug. I have entered a bug report, UE-5045 to be assessed by the development staff. Thank you!

Ok, thanks. Then I was thinking correct I guess. Thanks for the fast feedback btw :slight_smile:

Hi waxxab,

I realized my mistake and wanted to let you know. This is actually working as intended. What is occurring is that our colors are based on a 0-1 scale instead of 0-255. So effectively it has 255:256 chances to select the maximum value a color is going to be. Try setting your float in range to 0-1 and see if it works correctly after that.

Aha, okay. Is there another way of creating colors in the RGB space?

You can set the random range as you had it then normalize it so that it changes from the RGB scale to the 0-1 scale.