0 votes


is there a signal to check if the camera reaches the destination if the smooth movement mode is activated? If I change the camera Focus point, the cam needs some time to reach the destination...

in Engine by (65 points)

1 Answer

0 votes

I don't think so, but you can use code to check for that.

Code for parent:

var camera = $Camera2D
func _physics_process(delta):
    if $Camera2D.global_position.distance_to(global_position) < 1.0:
        #enter code here

The reason for the "< 1.0" is that Camera2D uses linear interpolation for smoothing its movement. The farther away its target is, the faster it will follow. This means that it will follow very slowly when it is near and it will reach its destination very slowly, if at all.

But if we use the "< 1.0" then we're forgiving it a bit for the sake of it working.

by (46 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 webmaster@godotengine.org with your username.