How to tween a part while it is already in motion?

  1. What do you want to achieve? I need it where the script tweens the part while it maintains it’s current position.

  2. What is the issue? My issue is that when the part is being tweened, it is moved to where it was first was, making me very frustrated.
    Example:


    https://gyazo.com/2cc0dbc395cd079a64db3a42b46f57e4

  3. What solutions have you tried so far? I have looked about everywhere, have no topic on this subject, and as well as trying to solve this issue using similar solutions.

Note: These parts are already mvoing before they’re tweened

local Service = game:GetService("TweenService")

part1 = workspace:WaitForChild("veyron").Body.spoilermech1.part01
part2 = workspace:WaitForChild("veyron").Body.spoilermech1.part0
part3 = workspace:WaitForChild("veyron").Body.spoilermech1.part1
part4 = workspace:WaitForChild("veyron").Body.spoilermech1.part2
part5 = workspace:WaitForChild("veyron").Body.spoilermech1.part3
part6 = workspace:WaitForChild("veyron").Body.spoilermech1.part4
part7 = workspace:WaitForChild("veyron").Body.spoilermech1.part5
-- Part Variables

-- Part Goals
local goal1 = {}
goal1.Orientation = Vector3.new(0, 0, 0)
goal1.Position = Vector3.new(part1.Position.X - 0.834, part1.Position.Y + 1.092, part1.Position.Z)
local tweenInfo1 = TweenInfo.new(0.7,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,1,true,0)
local Tween1 = Service:Create(part1,tweenInfo1,goal1)

local goal2 = {}
goal2.Orientation = Vector3.new(0,0,0)
goal2.Position = Vector3.new(part2.Position.X - 0.725, part2.Position.Y  + 1.248, part2.Position.Z)
local tweenInfo2 = TweenInfo.new(0.7,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,1,true,0)
local Tween2 = Service:Create(part2,tweenInfo2,goal2)

local goal3 = {}
goal3.Orientation = Vector3.new(0,0,0)
goal3.Position = Vector3.new(part3.Position.X - 1.042, part3.Position.Y  + 0.736, part3.Position.Z)
local tweenInfo3 = TweenInfo.new(0.7,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,1,true,0)
local Tween3 = Service:Create(part3,tweenInfo2,goal3)

local goal4 = {}
goal4.Orientation = Vector3.new(0,0,0)
goal4.Position = Vector3.new(part4.Position.X - 0.791, part4.Position.Y  + 1, part4.Position.Z)
local tweenInfo4 = TweenInfo.new(0.7,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,1,true,0)
local Tween4 = Service:Create(part4,tweenInfo4,goal4)

local goal5 = {}
goal5.Orientation = Vector3.new(0,0,0)
goal5.Position = Vector3.new(part5.Position.X - 0.952, part5.Position.Y  + 1.109, part5.Position.Z)
local tweenInfo5 = TweenInfo.new(0.7,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,1,true,0)
local Tween5 = Service:Create(part5,tweenInfo5,goal5)

local goal6 = {}
goal6.Orientation = Vector3.new(0,0,0)
goal6.Position = Vector3.new(part6.Position.X - 0.917, part6.Position.Y  + 1.01, part6.Position.Z)
local tweenInfo6 = TweenInfo.new(0.7,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,1,true,0)
local Tween6 = Service:Create(part6,tweenInfo6,goal6)

local goal7 = {}
goal7.Orientation = Vector3.new(0,0,0)
goal7.Position = Vector3.new(part7.Position.X - 0.718, part7.Position.Y + 1.231, part7.Position.Z)
local tweenInfo7 = TweenInfo.new(0.7,Enum.EasingStyle.Linear, Enum.EasingDirection.Out,1,true,0)
local Tween7 = Service:Create(part7,tweenInfo7,goal7)

--Tweening
repeat wait()
	if game.Players.LocalPlayer.PlayerGui:WaitForChild("A-Chassis Interface").Values.Velocity.Value.Magnitude >10 then
		Tween1:Play()
		Tween2:Play()
		Tween3:Play()
		Tween4:Play()
		Tween5:Play()
		Tween6:Play()
		Tween7:Play()
		wait(0.7)
		Tween1:Pause()
		Tween2:Pause()
		Tween3:Pause()
		Tween4:Pause()
		Tween5:Pause()
		Tween6:Pause()
		Tween7:Pause()
	end
	until game.Players.LocalPlayer.PlayerGui:WaitForChild("A-Chassis Interface").Values.Velocity.Value.Magnitude >10

If I’m correct, you should set the Boolean to false instead of true, to avoid it going back to it’s original position.

I keep it on true because I have the tween paused a little after it is played because I want to go back down after an action. I also should’ve posted the entire script, my bad

1 Like

Alright, I got it to stay in its same position while tweening, reading enough dev-forum posts works I guess.

1 Like