Model not tweening except primary part

so im currently trying to tween a door when a humanoid hits it, i looked around the devforum seeing that i had to weld all the parts to the primary part and then unanchoring all those parts except the primary one. and i did

but the issue is that the primary part is the only one moving, while the other parts just stay in place floating, as seen in the video below.

here is the code for the door:

local CopTeam = game.Teams.Guards
local Door = script.Parent

-- Tween
local TS = game:GetService("TweenService")

-- Doors
local Door1 = script.Parent.Parent.Door1
local Door2 = Door1.Parent.Door2

-- Debounce
local Debounce = false

Door.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		local Plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if Plr.Team == CopTeam then
			if Debounce == false then
				Debounce = true
				-- Door Outwards move tween
				TS:Create(Door1.PrimaryPart, TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = Vector3.new(1417.44, 526.036, 119.036)}):Play()
				TS:Create(Door2.PrimaryPart, TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = Vector3.new(1405.752, 526.036, 119.036)}):Play()
				wait(1.5)
				-- Doors Inwards move tween
				TS:Create(Door1.PrimaryPart, TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = Vector3.new(1413.44, 526.036, 119.036)}):Play()
				TS:Create(Door2.PrimaryPart, TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = Vector3.new(1409.752, 526.036, 119.036)}):Play()
				wait(3)
				Debounce = false
			end
		end
	end
end)
4 Likes

correct me if i’m wrong but if you tween the primary part i don’t think the other parts will keep their offset unless welded

3 Likes

i already welded them and i also mentioned that in my post, the issue is that none of those parts move

Maybe try tweening the origin position of each door?
EDIT: Nevermind

the thing is that i also tried doing it the bad way and tweening each part individually, yet none of them actually moved (i made sure they were anchored and the welds were deleted)

oh right forgot to mention that none of this printed errors

Hi, you cannot tween the PrimaryPart of a model if you want to tween the entire model.

You should instead take a look into this devforum tutorial that explains how to tween models:

https://devforum.roblox.com/t/introduction-to-tweening-models/315253

thing is that ive seen a lot of posts saying that i only need to set the primary part and then weld the other remaining parts to it (and those parts should be unanchored), which when tweening, will move the unanchored parts with it

One solution could be to lerp the model from the closed primary part position to the open primary part position and vice versa, although this can lead to the doors opening with choppy movement if done in a for loop on the server. However, you could send a remote event to a local script to lerp the doors for all clients via RenderStepped to yield a smoother and seamless result.

so bumping this thread, i decided to tween the parts individually, and lets say it partially worked…
the main door frame is still yet not wanting to move for some reason, the glass does and so does the base
i made sure nothing was interfering, even though tweening a part wouldnt be interfered by anything…


(ignore the no animations thing, i was just testing something)

i even exported the doors and made them objs (they were unions) to import them as meshes just to make sure, but it still doesnt wanna work

and yes the door frame is anchored

nevermind, after some more research i got it fixed.

so how did you end up doing it?

2 Likes

How did you fix it? I want to fix too.

1 Like

bro i got the same issue, we need the fix

Sorry i kind of forgot how to lol, i havent worked in this project in a long time and i didnt mean to be a little rude by not leaving a solution.

if i remember correctly simply weld all the parts to the primary part, set their collisions off except for that primary part and move the primary part, make sure to unanchor the other parts though

if not just simply manually tween each of the parts individually

again i dont remember much from this but you can use this post as a guide on how you could do it:

It’s because you’re probably tweening the PrimaryPart’s Position.

The way Roblox works is that when you update a part’s position property, rigid constraints like welds are temporarily disabled for the update in position. Same with rotation I believe? It’s somewhere in the documentation, probably the rigid constraints page.

The only way to move an entire assembly is by setting the root’s CFrame or using :PivotTo() (which essentially does the same thing). That’ll update all the welds at the same time. So if you’re gonna be tweening the model, tween the CFrame. I started doing that and it worked flawlessly.

1 Like