0 votes

How to make camera follow player by path?

Godot version 3.2.3
in Engine by (39 points)

1 Answer

0 votes

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
by (3,251 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.