Hey I’m trying to tween a door. I made a primary part which is invisible and covers the entire door. I connected all the welds to that part, and tried to tween it. However, only the primary part seems to be getting tweened. If anyone knows why this might be, please feel free to let me know. Your help will be appreciated.
Code:
local door1 = door.Door1
local door2 = door.Door2
local doorTweenInfo = TweenInfo.new(1,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
local door1TweenGoals = {CFrame = CFrame.new(Vector3.new(door1.PrimaryPart.Position + Vector3.new(door1.PrimaryPart.Size.X, 0, 0)))}
local door2TweenGoals = {CFrame = CFrame.new(Vector3.new(door2.PrimaryPart.Position - Vector3.new(door2.PrimaryPart.Size.X, 0, 0)))}
local door1Tween = TweenService:Create(door1.PrimaryPart, doorTweenInfo, door1TweenGoals)
local door2Tween = TweenService:Create(door2.PrimaryPart, doorTweenInfo, door2TweenGoals)
door1Tween:Play()
door2Tween:Play()
Update: I tried changing it’s CFrame, like without tweening and it still only changes the CFrame for the primary part rather than the entire model. Maybe there’s perhaps something wrong with the weld constraints?
One, you showed a code that’s supposed not to be used because of the deprecated functions used in it. Then, I already pointed out why it is deoptimized and how to optimize it(which is using the new pivot API functions). You then show a post that counters nothing but explaining why constraints shouldn’t be use in tweening models.
Second, your post is also invalid. You should’ve read further before posting: