How do i change the label's color in script?
TheEpicCookie Change its modulate property
xyz I keep trying and can't figure it out. This is what i wrote:
enemyDamagedLabel.Modulate = new Color(21, 145, 11, 255);
TheEpicCookie Color components need to be floating point values in 0.0 - 1.0 range.
- Edited
TheEpicCookie @xyz is right, it's float (unless you have "raw" enabled on the sprite?)
so your code SHOULD be:
enemyDamagedLabel.modulate = Color(0.09,0.56,0.05,1)
give or take a decimal point.
(255/max value = 1.0)
xyz SnapCracklins 3 errors appeared saying i can't convert from double to float
TheEpicCookie You need to use float literals with f suffix: .5f
xyz SnapCracklins Thank you!