DaCoolDevv
(DaCoolDevv)
September 5, 2023, 3:00pm
#1
So Basically, i want my part to freeze in it position when it tween service ends.
When the tween ends, it tweens back to the old position the part was on, the code:
local pos = button.Position - Vector3.new(0, defirence, 0)
local tween = tweenService:Create(button, TweenInfo.new(.4, Enum.EasingStyle.Sine,
Enum.EasingDirection.In,
0, false, 0), {Position = pos})
tween:Play()
1 Like
After playing the tween, try waiting for 0.4 seconds then set it’s position to pos or wait for 0.4 seconds, stop the tween with tween:Cancel()
then setting it to pos
1 Like
DaCoolDevv
(DaCoolDevv)
September 5, 2023, 3:51pm
#3
it does not play the tween, it just set the position, then cancel the tween, should i use tween.Completed?
1 Like
You need to save it’s original Position in a variable and then after the Tween is completed you set the part’s position to the saved variable.
1 Like
Tweens change the position of the part, so when it ends, the final position is the one that’s gonna be applied to it. You could just anchor the part.
DaCoolDevv
(DaCoolDevv)
September 5, 2023, 3:58pm
#6
I tried that, didn’t work, sadly, but thanks
1 Like
DaCoolDevv
(DaCoolDevv)
September 5, 2023, 3:59pm
#7
Thanks, i was having to anchor it!
2 Likes
system
(system)
Closed
September 19, 2023, 3:59pm
#8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.