✓ Accepted answer
Transparency from Unions, MeshParts, and other kinds of geometry are floats while Transparency on Beams and Trails are Number Sequences. To be honest, you can actually set them up manually by clicking on the Transparency property, then clicking the 3-dotted button to its right. Add nodes by clicking anywhere (in this case, lowest on the start and highest on the end) on the graph sequence (that's what I call it). Higher values means less opacity while lower values means less transparency.
If you want to put it in a script, then use the NumberSequence, and NumberSequenceKeypoint as shown here (copy if you want):
local Player = game.Players.LocalPlayer
local Character = Player.Character
numseq = {NumberSequenceKeypoint.new(0,0),NumberSequenceKeypoint.new(1,1)}
NS = NumberSequence.new(numseq)
Character.Arm1.ControlStone.Beam.Transparency = NS
I tried this and it is all fine (tested with Beam instance in Workspace, Script in Workspace.)
Hope this fixed your issue.
EDIT: If you want both sides to fade then try this:
local Player = game.Players.LocalPlayer
local Character = Player.Character
gradual = 140
waittime = 0.006
for i = 1, gradual do
wait(waittime)
numseq = {NumberSequenceKeypoint.new(0,i/gradual),NumberSequenceKeypoint.new(1,i/gradual)}
NS = NumberSequence.new(numseq)
Character.Arm1.ControlStone.Beam.Transparency = NS
end
Again, hope this fixed your issue.
Really sorry for the numerous edits because of mistakes.
11 comments
works but i want the whole beam to go from fully opaque gradually up to completely invisible
Thank you, I've learned something new! :)
@Asworme You're welcome. @SirTotten I will try to find a different solution.
Finally edited. View to the bottom of my answer.
it tells me "NumberSequence.new(): table of NumberSequenceKeypoints expected."
I realized that my new code was jumbled because of typing. I'll fix it.
Okay I edited ir again.
says the same thing on line 11 (for me its line 29)
Crap. I found out that I am calling a nonexisting variable. I am really sorry, will do better. Let me edit again.
it works, thanks man
Looked everywhere for the proper way to implement a new NumberSequence, thanks for the example.