I use the code
game.Workspace.walls.Union.Color = Color3.fromRGB(51, 77, 220)
to change a part to blue, but if I use it on another union:
game.Workspace.jletter.Union.Color = Color3.fromRGB(255,0,0)
nothing happens. UsePartColor is set to true on both unions.
1 Like
I would try testing the operation by using a different color or different execution like using BrickColor.new(). You might also try and duplicate the union and test the new object as well.
1 Like
I’m the Union properties, there is a boolValue called: “UseBrickColor”. Check that to true. Then try using ur script.
2 Likes
He mentioned already that UsePartColor is true for both unions.
3 Likes
This is correct. Any other reasons why?
Are you getting any output errors? Are you also providing all of the code?
2 Likes
Both examples are in the same script, one works and the other doesn’t.
The script is meant to change colors on the press of a surfacegui button.
script.Parent.MouseButton1Click:Connect(
function()
game.Lighting.Brightness = 3
game.Lighting.ClockTime = 12
wait(1)
game.Workspace.walls.Union.Color = Color3.fromRGB(51, 77, 220)
game.Workspace.walls.Union.Material = "Neon"
wait(2)
game.Workspace.logo.Union.Material = "Neon"
game.Workspace.jletter.Union.Color = Color3.fromRGB(255,0,0)
wait(1)
end)
.
Are any of the errors in the output related to your script? I would also check the properties of the union to see if the color was affected. If it isn’t then the code hasn’t run if it has it’s simply that the usepartcolor isNt true
2 Likes
Usepartcolor is true, and I don’t see anything relating to line 10 of that script
If it is related to that script at all then it can cause it to stop working. What error references the script name?
This refers to the script that activates it.
line 9 says:
game.Workspace.logo.Union.Material = "Neon"
Try using game.Workspace.logo.Union.Material = Enum.Material.Neon
2 Likes
Unfortunately, it still doesn’t work.
Do you have any new errors? Also make sure to change line 7 to the same thing.
1 Like
I did change line 7.
I’m also getting this, which just says line 9 is starting. What does union is not valid mean?
It means either the union is not in the model or the script is run before the union is loaded. Try using
game.Workspace.Logo:WaitForChild(“Union”)
1 Like
So
game.Workspace.jletter:WaitForChild("Union") = Color3.fromRGB(255,0,0)
1 Like
Yes this is correct. If this doesn’t work then the problem is the same and we need to find out why the script can’t find the union
2 Likes
Nothing happens, maybe it’s a problem with the union itself.
1 Like
Unions can be unreliable I’d advise trying meshes instead
1 Like