TweenPrimary Part is not moving all the other Parts with it. (Model)

So I was trying to make the TweenPrimary Part just move upwards with all the parts with it its a model btw. But when I try to make it work its just moving the Primary part not the rest that is Welded.

The script (localscript):

local function namepadinput()
	print("Started NamePindPadInput")
	-- Replace "PartToMove" with the name of the part you want to move
	local part = workspace:WaitForChild("NameInputWaiverPad").PrimaryPart

	-- Set the target position and rotation
	local targetPosition = Vector3.new(part.Position.X, part.Position.Y + 3, part.Position.Z)
	--local targetRotation = Vector3.new(-10, 0, 0)

	-- TweenInfo settings
	local tweenInfo = TweenInfo.new(
		1,              -- Duration in seconds
		Enum.EasingStyle.Linear, -- Easing style
		Enum.EasingDirection.Out, -- Easing direction
		0,              -- Number of repeats (use 0 for no repeat)
		false,          -- Reverses the animation if true
		0               -- Delay between repetitions
	)

	-- Create the tweens
	local positionTween = game.TweenService:Create(part, tweenInfo, {Position = targetPosition})
	--local rotationTween = game.TweenService:Create(part, tweenInfo, {Orientation = targetRotation})

	-- Play the tweens
	positionTween:Play()
	--rotationTween:Play()

	-- Wait for the tweens to finish before continuing (optional)
	--positionTween.Completed:Wait()
	--rotationTween.Completed:Wait()
end

Explorer:

Welded Model with all the parts.

Can someone help me? Thanks.

5 Likes

Are the welded parts anchored? If so unanchor them

1 Like

Oh are they supposed to be anchored…

Oh no they are unanchored every single one of them.

Do you use WeldConstraints or Welds?

1 Like

WeldConstraints just that I made it faster with this script.
and putting this into the Command bar.

local model = workspace.NameInputWaiverPad
local primary = model.PrimaryPart

for i, part in pairs(model:GetChildren()) do
	if part:IsA("BasePart") and (part ~= primary) then
		local weld = Instance.new("WeldConstraint", part)
		weld.Part0 = part
		weld.Part1 = primary
	end
end

From what I know a weldconstraint just prevents the part to be pushed over without being anchored, however you should maybe use Welds, as they are working fine with moving objects. I am no welding expert but I tried it in a seperate place

1 Like

Alr I will try that out let me see give me a sec.

Hmmm like so?

I guess that would work, you can try it out

1 Like

Do everything just as they said but, don’t use WeldConstraints, use Welds.
I use this plugin … Welder

I used your script and these welds and it works fine in testing.
I did change one thing however:

local part = workspace:WaitForChild(“NameInputWaiverPad”):WaitForChild(“Part1”)

Cuz I don’t like to use a modal with primary and always go off a object. Not sure if that matters but that’s what I did … also once you add them welds if you manually move it all the welds will be removed.

Well you can move the whole thing at once but not a part in it. Just the way them welds work.
Just have to add them again and leave it alone after that …

In my case I welded all the parts to my part1 the one I was moving. That one can be anchored the rest can’t.

2 Likes

Yea did not work… well I’ll see

Yea but after I welded without the weld constrain the model and unanchored it it just broke apart in roblox studio so uhm- yea

image

1 Like

All the unanchored parts are welded to the one anchored part you’re moving.
testplate.rbxl (55.4 KB)
My test script ^^^^

Here is the model maybe I did something wrong.
Pad_weld_problem.rbxm (11.8 KB)

Ya them welds like to pull parts together … they are a one time ATM set. So order of how you do this matters in this case.

1st remove all the welds. Then make all the parts but the primary unanchored …
Now you’re ready to weld them together … with the primary part anchored.

robloxapp-20240118-1329494.wmv (302.3 KB)

Them welds can be a pain till you understand how to use them … then they become magical … :slight_smile:

That video is your exact script, with the welds added.

1 Like

Thanks I will see!! Maybe and hopefully this will work

Thanks it worked but it is pain :confused: can you send me the place that you showed in the video. Would be much appreciated!!

I did … that is the test script. (testplate)
Stick with it and figure it out … them welds can do crazy cool things.
Keep in mind everything needs to be set up right before you weld.

Oh the one in the video … ya I deleted that. Just do it in order and you’ll be fine.

1 Like