Change textbutton backgroundcolor3, "value cannot be assigned to"

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to change the backgroundcolor3 of a textbutton using color3value
  2. What is the issue? Include screenshots / videos if possible!
    It won’t change and stays the same color and the output: Value cannot be assigned to

the script
local tb = game.ReplicatedStorage.InventoryTemplate:Clone()
tb.BackgroundColor3.Value = game.Players.LocalPlayer.Folder.Color3Value.Value
tb.Parent = inventory
—(more other lines changing stuff)

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I looked at others but none were having my problem. Even when I changed it to

tb.BackgroundColor3.Value = Color3.fromRGB(game.Players.LocalPlayer.Folder.Color3Value.Value)
the output is still the same.

Edit: Also even doing: tb.BackgroundColor3.Value = Color3.fromRGB(255,255,255) it still has the same output

If this is a UI object you should just use BackgroundColor3 not BackgroundColor3.Value

1 Like

Thank you! I thought I had to do value lol

1 Like

No, since Color3 is technically an object (not instance; datatype), it probably thinks you’re trying to assign to a property of the Color3 and since Color3s aren’t mutable, it won’t work. Basically the same reason why we can’t assign to an axis in a Vector3, instead we have to create a whole new Vector3.

1 Like