How to make an object follow another object similar to interpolated camera follow?

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

Hi All. New here, just getting started with Godot. I was wondering what would be the best way to make an object look at and follow another object (a target) in the scene in the same fashion that the interpolated camera does?

The followed object would be a rigid body tumbling down a hill (physics). The follow object would be a parachute behind it to slow it down.

In Armory the ‘look at/follow’ node/trait can simply be added to anything. In Godot this seems to only be a feature for the camera (although I am sure you can write a script that achieves this?) Thank you!

:bust_in_silhouette: Reply From: hammeron

Transform class have a function for interpolation.

func _process(delta: float) -> void:
	global_transform = global_transform.interpolate_with(target.global_transform, delta * speed)