Object Train Algorithm

I have two snake objects - a head and a body. Each mesh has two more child objects at the beginning and at the end (A,B points). Point C - is the center of the object. Points B,C and B1,C1 are located in the same coordinates. The body looks at the head >
When I press the “W” button the head goes forward and I need to close the distance from the body mesh. I know the coordinates of all points and distances D and D1. How can I shift
my body mesh by distance D2 so that A1 is at point B? At the same time using vectors.


or chain physics

for lerp you can do a moveto type of function pos = lerp(pos, target, speed)

1 Like