How do I make a part's position stay on another part's?

I thought I would be able to do this myself, but I was surprised to finally basically nothing on the internet with what I needed.

Basically, there’s a main part called “Part0” that is tweened upward overtime. Then there are 3 other parts (Part1, Part2, and Part3) that are somewhere else in the workspace in a secret location. I wanted to make a script that could make a part go to Part0’s exact position while it’s tweening and have the part go upwards with Part0. The script would also be able to switch Part1 out for Part2, Part2 out for Part3, etc. When the parts are switched out, for example when Part1 is switched out for Part2, Part1 will be going upwards with Part0 but then would be put back in the secret location while Part2 is taken from the secret location to replace Part1 and go upwards with Part0. How would I achieve this?

You can use Welds Or WeldConstraints to join parts together. (I would recommend WeldConstraints).

2 Likes

I tried welds, but the parts wouldn’t move with the tweening part

2 Likes

is the part you are welding anchored?

No

Is there a way I can do it with a script?

you could use a while loop to set the position of the part to the position of the other part.

1 Like

Tweening works on Anchored Parts.
Weld the other Parts to the tweened Part, make them all Transparent and CanCollide false, then just make the Part you want to appear Cancollide true and not Transparent.
This way you don’t have to hide them elsewhere and move them to the tweened Part because they’ll already be attached.

The script is for a map in another game and idk how that game’s code works, but usually the parts are already CanCollide by default to work. It’s kinda confuding but I can’t just make the parts CanCollide false and invisible, they have to not be there.

It works! I thought it would look weird or laggy using a while loop, but it actually looks extremely smooth. Thank you!

while task.wait() do
	Part1.Position = Part0.Position
end

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