# Making a Tween inside of a moving Tween

I have this Elevator like the Tower of Terror ride. And I am trying to have this elevator move with this tweened gate. I know the basics of tweening but when I have to move the elevator I am not sure how to make the gate go with it while being able to open and close.
I can’t quite figure this out because when I weld the elevator to its own tween. It is just going to anchor the tween for the gate. I hope this does not seem confusing. I am just looking for some guidance.
Here’s a picture.

1 Like

You can try adding the two positional vectors to get the desired results.

local TweenService = game:GetService("TweenService")

local YOUR_TIME,ELEVATOR_POSITION,DOOR_POSITION = 1,Vector3.new(),Vector3.new()

TweenService:Create(Elevator,(TweenInfo.new(YOUR_TIME,Enum.EasingStyle.Linear),{Position =ELEVATOR_POSITION}):Play()

TweenService:Create(Door,(TweenInfo.new(YOUR_TIME,Enum.EasingStyle.Linear),{Position =ELEVATOR_POSITION + DOOR_POSITION}):Play()

Keeping the Easing style to linear should, mathematically produce the desired result.

Is it possible to weld the doors to the elevator, and tween the C0 or C1? If not you could write a custom tween system to do it. Writing a custom tween system isn’t as difficult as it sounds.

You could use WeldConstraints, and you don’t need to constantly tween C0 and C1. All you would need to do is move one of the parts with TweenService, and boom! The entire model moves at once.

How does the gate tween while attached to the elevator with a weld constraint?

I am very confused by that question, but once you select everything and weld it at once, you would do any part inside of the model, because it would be welded.

I believe that the original post is asking how to tween a gate open and closed while also on an elevator that is tweening.

Oh, I get it now. So make sure the gate is inside of a model or folder to keep things organized, use WeldConstraints to move all of the parts at once, and maybe HingeConstraints.

Sorry, I am not the best at this kind of stuff. I thought you just wanted the model to move. There is also this that really helped me learn how to tween models, and I believe it has your use case inside of it: