How to make a part follow another part [AND THEY MUST ALWAYS BE AT A FIXED DISTANCE FROM EACH OTHER]

I want a part to follow another part, where the 1st part is being tweened. However, the part cannot just be directly following it. Both parts must be able to go through curves like these

I have tried using tables, where 2nd Part CFrame is set to 1st part CFrame in the past, thus they look like they are following each other. HOWEVER, This only works when the tween is linear. My Part has to go through multiple tweens, which have different TweeningStyles. Using the table method causes them to not be at a fixed distance

Can anyone think of anyway for me to achieve this?

2 Likes

Have you tried to set the goal of the tweens slightly behind the target part?

What do you mean by this? 30charrrrrrrr

Find the LookVector and subtract this value from the leading part, you will usually get a position right behind it, unless it was rotated in a certain way.

Whats a lookVector? I tried reading the documentation but i could not make sense of it. Also, could you include a sample of what you mean in a script? [Not asking you to script the whole thing, just show me how to use lookVector so i know abit of what im doing as i have nevered use lookVector before]

LookVector is a property that yields exactly one stud in the direction the part is facing, the normal for the front.

What if my part is facing a orientation, like 45,0,0. If its at 0,0,0 XYZ, what does lookVector yield [EXAMPLE]

Couldn’t this be solved by connecting the parts via a rod or rope constraint? I think it would still work for turns, but I’m not sure

Vector3.new(0, 0, 1), it only depends on the orientation and not any position. This is the default.

For the 45 degrees, it would appear to be 0.5. I don’t have the exact configuration in my head.

Insanely buggy and glitchy. Thats why i didnt want to use any physical constraints

why dont you just apply the same tweens to part 2 except delayed?
you can use

task.delay(delay_time_in_seconds, tween_function)

where your function can be the tween. you could also do it like this:

task.delay(delay_time_in_seconds, function()
   tweenService:Create(tween_stuff_1)
   tweenService:Create(tween_stuff_2)
   tweenService:Create(tween_stuff_3)
end)

you could also simply use task.wait(time_in_seconds)