So pretty much i’m trying to tween a elevator to move u and down, what I’m trying to do is make everything move with the primarypart put it will not work, here is the script and screenshot on what happens.
local TweenService = game:GetService("TweenService")
local model = workspace.ElevatorPanel
local TweenPart = model.PrimaryPart
for i, part in pairs(model:GetDescendants()) do
if part:IsA("BasePart") or part:IsA("MeshPart") and (part ~= TweenPart) then
local Weld = Instance.new("WeldConstraint", part)
Weld.Part0 = part
Weld.Part1 = TweenPart
end
end
local TweenInfo1 = TweenInfo.new(
5,
Enum.EasingStyle.Sine,
Enum.EasingDirection.In,
0,
false,
0
)
local Goal1 = {
CFrame = TweenPart.CFrame * CFrame.new(TweenPart.Size.Y + 0,0.1,0)
}
local Tween1 = TweenService:Create(TweenPart, TweenInfo1, Goal1)
wait(10)
Tween1:Play()
print("Playing tween")
So right now I don’t care that it’s moving forward I’ll adjust that later but this is all thats moving
the elevator button and the primarypart which is invisble and covers the whole model.
I don’t understand the goal here, you’re stating you want to tween a elevator up and down but the code states the elevator panel. I’m just a little confused that’s all?
I’m not entirely sure what I did wrong, if anyone is willing to help, that would be great.
I’m not sure what you want, but it seems like you want to move the elevator like a cage, and to do this, you can do something like this: local TweenService = game:GetService(“TweenService”)
local model = workspace.ElevatorPanel
local TweenPart = model.PrimaryPart
local Tween1 = TweenService:Create(TweenPart, TweenInfo1, Goal1)
for i, part in pairs(model:GetDescendants()) do
if part:IsA(“BasePart”) or part:IsA(“MeshPart”) and (part ~= TweenPart) then
local Weld = Instance.new(“WeldConstraint”, part)
Weld.Part0 = part
Weld.Part1 = TweenPart
end
end