Tween Service | I want my part to stop in it position when the tween service ends

  • 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()
  • Using the tween.Completed then setting the part position to pos, but still isn’t working.

    • | Thanks for reading!
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

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.

I tried that, didn’t work, sadly, but thanks

1 Like

Thanks, i was having to anchor it!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.