Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a fading decal?

Asked by
Belvari 15
8 years ago

How do you make a decal fade, from a color to another color? Like, A White decal that fades from like orange to blue or something of the matter, I'd like it to change in a rainbow pattern like any color, it turns from One Color, to Another, how would you do that? Could someone demonstrate me, by giving out an example? This is what I have so far, I used the Image label method, but, I want to add a nice fade effect so it doesn't just change color with some choppy effect.

while true do
x = (math.random(0, 10) * .1)
y = (math.random(0, 10) * .1)
z = (math.random(0, 10) * .1)
script.Parent.ImageColor3 = Color3.new(x, y, z)

end 

1 answer

Log in to vote
1
Answered by 8 years ago

Well, there's a few ways to do this. But you'll need the different colors made and uploaded to start. Once you have those make the decal and insert a serverscript into it with the following code:

decal = script.Parent
colors = {(123), (234), (345)} -- Put the decal id's here. Change the numbers to the id's.

texture = 1
while true do
decal.TextureId = ("http://www.roblox.com/asset/?id="..colors[texture]) -- This makes the TextureId into w/e number texture is equal to in the table.
texture = texture + 1
if texture >= 3 then -- Change 3 to the number of colors in the table.
texture = 1
end
wait(1) -- Change to how long you want the color to exist.
end
0
Well That's not quite fading and it requires making multiple decals, Which I have tried. :/ I've made one without having multiple decals. You take a white decal, add an image label, Then use this script. while true do x = (math.random(0, 10) * .1) y = (math.random(0, 10) * .1) z = (math.random(0, 10) * .1) script.Parent.ImageColor3 = Color3.new(x, y, z) end <- That's what I have so far But, I w Belvari 15 — 8y
0
I editted the question, And added a code block of what I have so far Belvari 15 — 8y
0
Well, you mentioned using a decal, not an imagelabel so I was going off using a decal. I can work on a model for you that's easy to edit if you're still having trouble. OneTruePain 191 — 8y
0
Sorry, But, Yes that'd be great if you could. Belvari 15 — 8y
Ad

Answer this question