Error with Color3:lerp()

Hello, developers!

I’m having an issue with Color3:lerp() (I’m making a health tag). It’s giving me an error “Unable to cast Color3 to float”. What am I doing wrong?

script.Parent.Bar.BackgroundColor3 = script.Parent.Bar.BackgroundColor3:lerp(Color3.fromRGB(0,255,0), Color3.fromRGB(255, 0, 0))

The error is very literal, Lerp doesn’t accept a Color3 value. You passed a Color3 to Alpha, the second parameter, when you should be passing a float which is a number between 0 and 1.

BackgroundColor3:Lerp(secondColor3, 0.5)
1 Like