Hi developers!
I’m attempting to tween a part 2 times, one to move up, and after 3 seconds, move to its original position.
The part moves upwards just fine, but after waiting 3 seconds, will not move back down. No errors are being outputted, so I’m a bit confused on what’s exactly going on.
I’ve double checked documentation and looked at past forum posts, but to no avail.
local part = script.Parent
local tweenService = game:GetService('TweenService')
local Position = script.Parent.Position
local originPos = part.OriginPos.Value
local tweenInfo = TweenInfo.new(
1,
Enum.EasingStyle.Bounce,
Enum.EasingDirection.Out,
0,
false,
0
)
local goal = {
Position = part.Position + Vector3.new(0,5,0)
}
local goal2 = {
Position = originPos
}
while true do
task.wait(3)
local rise = tweenService:Create(part,tweenInfo,goal)
rise:Play()
task.wait(3)
local fall = tweenService:Create(part,tweenInfo, goal2)
end
Help would be greatly appreciated!