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

How would you make a fade effect for a part?

Asked by 5 years ago
Edited 5 years ago

so i'm not sure if this involves a script or not, but i want to make it so there is a part and that part, as it gets higher, fades to be come invisible, kinda like in VS (vehicle simulator) if anyone knows how to do this, it would be great. thanks :)

EDIT: i dont think i explained this very well, so i will try again, so lets say i wanted a part (lets use a square in this scenario) I would want that square to have a gradient effect, i dont want to change its transparency, but i want a decal with a gradient effect where it is partially see through. if you play Vehicle simulator, then you know that at the start of races, you get in queue by going into a box that has a gradient effect around it.

3 answers

Log in to vote
2
Answered by
Dog2puppy 168
5 years ago

Not sure by what you mean by it getting higher, but for a slow fading effect you cloud do something like this:

for i=1, 100 do
    script.Parent.Transparency = script.Parent.Transparency + 0.01
    wait(1)
end

I haven’t tested the above code, but what it should do is slowly make the part more transparent over the course of 100 seconds.

Ad
Log in to vote
0
Answered by 5 years ago

You want to use a for loop that increases the transparency on every iteration like so

local part = (the part you want to fade)
for i = 1, 100 do
    part.Transparency = part.Transparency + .01
    wait()
end

You can change the wait time or the other values to change how fast or smoothly it fades

Log in to vote
0
Answered by 5 years ago

I've found myself asking this question too. Here's a link to a possible solution:

https://www.roblox.com/library/141565737/Fade

I haven't used this decal (yet) but make sure you make your part's transparency to 1.

Answer this question