Camera 3D by Path

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

How to make camera follow player by path?

:bust_in_silhouette: Reply From: Magso

The easiest way I’ve come up with is to move it based on distance but it’s crucial to design the level in a way that doesn’t allow the player to venture too far off the path.

path_follow.offset += player.global_transform.origin.distance_to(camera.global_transform.origin) - 10
#the last value should be the closest distance the player can get before the camera moves backwards