Peaspod
(Peaspod)
#1
-
What do you want to achieve?
I want to be able to change the time attribute for an already instantiated tween object.
-
What is the issue?
I’m calling the SetAttribute function on a tween object as such:
local tweenTime = 3.5
local newTweenTime = 2.5
local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local tweenProperties = {}
tweenProperties.Position = UDim2.new(0, 0, 0, 0)
tweenProperties.Size = UDim2.new(1, 0, 1, 0)
local tween = TweenService:Create(guiObject, tweenInfo, tweenProperties)
wait(5)
tween:SetAttribute("Time", newTweenTime)
After I try setting the time attribute, I get the following error:
Attributes are not currently enabled
-
What solutions have you tried so far?
I’ve searched the Dev Forums and couldn’t find anything.
2 Likes
sjr04
(uep)
#2
Attributes are not released yet. And don’t tweens already have a Time
property?
2 Likes
Peaspod
(Peaspod)
#3
They do but I think it’s read only. Is there any way of changing the time of a tween without having to recreate it?
sjr04
(uep)
#4
Why do you want to do this? Why not just :Play()
the tween?
1 Like
Peaspod
(Peaspod)
#5
Sometimes the tween will need to play slow and other times I want it to animate faster.
sjr04
(uep)
#6
In that case just use a lower time for TweenInfo.new(n)
?
I know you said you didn’t want this but it looks like it’s the only way.
1 Like
BenSBk
(Ben)
#7
Attributes are separate from properties. Setting the Time attribute of a tween will not influence its Time property.
It is impossible to change the time progress of a tween.
1 Like
Peaspod
(Peaspod)
#8
Alright, no worries. I’ll just recreate the tween using new TweenInfo.
Thanks!
2 Likes