Can't tween when I can't do a union

I want to tween a door, but this door was made with multiple parts.
Unfortunately, when I tried to union the door, this happens:

Before union:


After union:

Unfortunately, I can’t tween with models (I don’t know why). So what can I do ?
Script:

local openPart = script.Parent
local door = workspace.Door	
local TweenService = game:GetService("TweenService")
local debounce = false


local tweenInfo = TweenInfo.new(
	3,
	Enum.EasingStyle.Exponential,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)
local openDoor = {
	CFrame = door.CFrame + Vector3.new(0,0,4.75)
}

local closeDoor = {
	CFrame = door.CFrame + Vector3.new(0,0,0)
}
local tween1 = TweenService:Create(door, tweenInfo, openDoor)
local tween2 = TweenService:Create(door, tweenInfo, closeDoor)

openPart.Touched:Connect(function(hit)
	if debounce == false and hit.Parent:FindFirstChild("Humanoid") then
		tween1:Play()
		debounce = true
	end
end)

openPart.TouchEnded:Connect(function(hit)
	if debounce == true and hit.Parent:FindFirstChild("Humanoid") then
		tween2:Play()
		debounce = false
	end
end)```

and btw how do I make it less buggy because the tween is bugging when I move?

The tween is bugging cause youre tweening it in a server script probably. If you want everyone to see the tween use a remore event that fires to all clients. And you can tween models, try welding the parts of the model together and then tween the primary part.

Here is one of my very old scripts I used for a project long ago. It tweens a model ‘Car_1’ or ‘Car_2’, but their parts are welded together, that is very important.

local ts = game:GetService("TweenService")

local car_1 = script.Car_1
local car_2 = script.Car_2

local pointA = workspace.Futuristic_Alley.Backdrop.PointA
local pointB = workspace.Futuristic_Alley.Backdrop.PointB
local pointC = workspace.Futuristic_Alley.Backdrop.PointC
local pointD = workspace.Futuristic_Alley.Backdrop.PointD

local function moveCar(carModel, pointX, pointY)
	local car = carModel:Clone()
	car.Parent = workspace
	car:SetPrimaryPartCFrame(pointX.CFrame)

	local randomSpeed = math.random(2 ,4)
	local tweenInfo = TweenInfo.new(randomSpeed, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
	local tween = ts:Create(car.PrimaryPart, tweenInfo, {CFrame = pointY.CFrame})

	tween:Play()
	
	tween.Completed:Connect(function()
		car:Destroy()
	end)
end

local function loopCars()
	local randomCar = math.random(1, 2)
	local randomTrack = math.random(1, 2)

	if randomCar == 1 then
		if randomTrack == 1 then
			moveCar(car_1, pointA, pointB)
		else
			moveCar(car_1, pointC, pointD)
		end
	else
		if randomTrack == 1 then
			moveCar(car_2, pointA, pointB)
		else
			moveCar(car_2, pointC, pointD)
		end
	end
end

while true do
	local randomNumber = math.random(1, 3)
	loopCars()
	wait(randomNumber) 
end

Make a primary part for the model. Preferably an invisible part located at the pivot of the model.
Set the primary part anchored to true, then, unanchor and add weld constraints to all other parts linked to the primary part.
Tweening the primary part will now tween all welded parts aswell.

Hello, sorry for the long wait.
I tested it , welded every parts to the primary part and I set every parts inside of the primary parts like so:


Unfortunately when I play, the only moving things are the PrimaryPart and the Door, but not the rest:

How can I fix this issue?

Nevermind I just unanchred the 2 parts and it worked :slight_smile:
Thanks a lot for the help

1 Like

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