How to make an object follow another?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By wbgyor

I have a Rigidbody2D which moves around the scene based on input . How to make another Rigidbody2D follow the former in the same path behind it?

:bust_in_silhouette: Reply From: Amateur.game.dev.

Duplicate the RigidBody2D and make the starting point of the second body so it’s behind the first body.

:bust_in_silhouette: Reply From: netimu

I’m not sure what sort of following here but I think one solution could be to use interpolation. you can find details on it in the docs: Interpolation — Godot Engine (stable) documentation in English

You could play around with the position you “interpolate to” and the speed to maybe get the behavior you want.