Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help with Color3.fromHSV()! (I have no clue what's going on) [?]

I have this very simple line of code, it is supposed to change my health bar's color from Hue Saturation and Value, but it just turns the bar's color to red. I used print to print the color, and here is what the output told me 255, -49725, -2.97079e+007 You aren't supposed to have negatives or decimals in Color3 values, and I have no idea why that is the color. Please help me!

script.Parent.BackgroundColor3 = Color3.fromHSV(math.floor(health*100/maxHealth),255,255)

2 comments

0

color3 only goes from 0 to 1 so try using "Color3.fromRGB" maybe?

0

fixed it by removing the * 100 and changing 255s to 1s

1 answer

✓ Accepted answer

fromHSV's arguments must be within range 0-1, not 0-255.

This discussion is preserved as it was. New answers, comments, and votes are closed.