TintinDevs
(TintinDevs)
August 18, 2021, 8:55pm
#1
The following script doesn’t run the tweening animation, OR it runs it once. (I can’t see because the game takes too long to load) Is there an error in the code?
local tweenInfo = TweenInfo.new(
2,
Enum.EasingStyle.Circular,
Enum.EasingDirection.In,
-1,
true,
0
)
local ending = {
["Position"] = script.Parent.Parent.Tele1_2.Position,
}
script.Parent.Position = script.Parent.Parent.Tele1_1.Position
game:GetService("TweenService"):Create(script.Parent, tweenInfo, ending)
You have to call :Play() on the tween through a variable
2 Likes
TintinDevs
(TintinDevs)
August 18, 2021, 8:57pm
#3
Is “Create” creating a variable for me to “play” ?
2 Likes
local tween = tweenservice:Create()
tween:Play()
3 Likes
jahoobas
(jahoobas)
August 18, 2021, 9:00pm
#5
If you want it to loop I recommend putting the tween:Play() in a while loop. Just do while true do
3 Likes
TintinDevs
(TintinDevs)
August 18, 2021, 9:04pm
#6
Will the code continue to run or will it wait until the tween is finished? Will tween:Play():Wait() work to stop the script until the tween is finished?
2 Likes
jahoobas
(jahoobas)
August 18, 2021, 9:14pm
#7
it would run forever I hope i helped
TintinDevs
(TintinDevs)
August 18, 2021, 9:16pm
#8
I meant if I changed the looping to 1 instead of -1, is there a way to know when the tween ends (or do I have to make a wait() manually