Hello, I’m trying to change a Color3 value using a variable.
My variables are pre-set using this local variable set.
My code looks for a message chatted by me, and then re-colors a, which was set previously as model:GetChildren().
Most of this code works as it should. However, Color3.fromRGB() is returning (0,0,0) when attempting to get Color value.
Everything else works completely as intended. The Color3 values are changed, and CurrentColor is changed. However, it’s all changed to black. How do I go about returning the proper Color value via a Color3Value class?
This is because when you get the Value of a Color3Value, it returns the RGB components as decimals between 0 and 1. Try changing Color3.fromRGB(red) to Color3.new(red) and see if it works.
The reason why you were getting 0, 0, 0 as your RGB values when you use fromRGB is because the numbers you get from ColorRed.Value are [0.592157, 0, 0]. As you can see, these are so close to 0 that they may as well be 0, because Color3.fromRGB takes in the colour components as numbers between 0 and 255.