meediaman
(mediaman)
September 16, 2023, 9:58pm
#1
I’ve seen posts about using just one or two points for tweens but I’m not sure how to do this using more than two points
I’ve seen games tween both ends of an object so the transparency starts from the middle, and I want to do that, but I don’t know how
meediaman
(mediaman)
September 17, 2023, 11:09pm
#2
if anybody has ideas I’m welcome to them
Sure! For tweening several points in a UIGradient, you can use a custom animation system, you should be able to manually interpolate between different keyframes doing so. This is the idea I posit.
meediaman
(mediaman)
September 18, 2023, 8:01pm
#4
and that animation system could be?
local TweenService = game:GetService("TweenService")
local StarterGui = game:GetService("StarterGui")
local ScreenGui = Instance.new("ScreenGui", StarterGui)
local Frame = Instance.new("Frame")
Frame.Size = UDim2.fromOffset(250, 350)
Frame.Position = UDim2.fromScale(.5, .5)
Frame.AnchorPoint = Vector2.new(.5, .5)
Frame.BorderSizePixel = 0
Frame.Parent = ScreenGui
local Gradient = Instance.new("UIGradient")
local numberSequence = NumberSequence.new{
NumberSequenceKeypoint.new(0, 0),
NumberSequenceKeypoint.new(0.5, 1),
NumberSequenceKeypoint.new(1, 0),
}
local numberSequenceTween = NumberSequence.new{
NumberSequenceKeypoint.new(0, 0),
NumberSequenceKeypoint.new(0.75, 1),
NumberSequenceKeypoint.new(1, 0),
}
Gradient.Transparency = numberSequence
Gradient.Parent = Frame
TweenService:Create(Gradient, TweenInfo.new(.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {Transparency = numberSequenceTween):Play()
print("Sucess!")