Welded Parts do not move when tweening

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

I want to tween a car for a cutscene by adding a RootPart which is welded to all the other parts.

  1. What is the issue? Include screenshots / videos if possible!

I welded all parts together, but when i play the tween, just the RootPart is moving, as you can see on the Video and Screenshots.

That is my script!

local tweenService = game:GetService('TweenService') 
		local Endposition = '(-46.346, 49.906, -1675.334)' 
		local pattern = '%((.-), (.-), (.-)%)' 
		local function convert(s) 
			local x, y, z = s:match(pattern) 
			local sus = Vector3.new( 
				assert(tonumber(x), x), 
				assert(tonumber(y), y), 
				assert(assert(tonumber(z), z) 
				)) 
			return sus
		end 
		local EndPositionVector = convert(Endposition) 
		local tweenInfo = TweenInfo.new(30, Enum.EasingStyle.Cubic, Enum.EasingDirection.In, 0, false) 
		local Tweentest = tweenService:Create(script.Parent, tweenInfo, {Position = EndPositionVector} )  
		Tweentest:Play()
  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Reading trough thiss post and doing the steps:

If you want to move the entire model (I believe that’s what you’re trying to achieve), then you can simply tween the PrimaryPart of your model. When doing this make sure all parts are properly welded to the PrimaryPart to your liking.

Replace your line to this (I assume the script’s parent is the model?):

local Tweentest = tweenService:Create(script.Parent.PrimaryPart, tweenInfo, {Position = EndPositionVector} )

Hope this helps.

1 Like

Nope, not working :frowning: I dont know what else the problem could be because the code should work 100%…

I have been experimenting around and I think I found the problem.

Use CFrame instead of a Vector3 value for the final position for the tween.

I took a sample of your script and integrated it into a model with a set of parts welded to a PrimaryPart with the end goal being a Vector3:

local model = script.Parent
local ts = game:GetService("TweenService")

-- end = 4.039, 9.525, 16.73

local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Cubic, Enum.EasingDirection.In, 0, false) 

local Tweentest = ts:Create(model.PrimaryPart, tweenInfo, {Position = Vector3.new(4.039, 9.525, 16.73)} )  
Tweentest:Play()

Result with Vector3 value:

And now the script modified to have a CFrame value as its end goal:

local model = script.Parent
local ts = game:GetService("TweenService")

-- end = 4.039, 9.525, 16.73

local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Cubic, Enum.EasingDirection.In, 0, false) 

local Tweentest = ts:Create(model.PrimaryPart, tweenInfo, {CFrame = CFrame.new(4.039, 9.525, 16.73)} )  
Tweentest:Play()

Result of this modified script:

Let me know if this works.

1 Like

Yes it worked!! Thank you very much for your help i really appreciate that!! Thanks for taking your time for me!

1 Like

Happy to help, good luck with your project!

1 Like

Thx! Maybe if i get finished, and i remember you, i will message you so you can test. xD But BIG maybe! :slight_smile:

1 Like

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