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

How do you make Rays fade away from a given transparency to completely transparent?

Asked by 6 years ago

I have created a firearm for a Western Game I am creating for an A Level project. The firearm works as intended, however I would like to make the shots look a little more stylish, and have the Ray fade from 0.8 Transparency to Completely transparent, in 0.2 seconds. Any advice on how to do this?

1 answer

Log in to vote
1
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago
Edited 6 years ago
local ts = game:GetService("TweenService")
local goal = {}
goal.Transparency = 1
local info = TweenInfo.new(0.2,Enum.EasingStyle.Quad,Enum.EasingDirection.Out)
local tween = ts:Create(rayPart,info,goal)
tween:Play()

You can also play around with the EasingStyle and EasingDirection for different effects.

Ad

Answer this question