0 votes

I have a 2D topdown game where my player is moving during turns away from the cam, but in the end of every turn the cam is focusing back on the player. However the movement of the cam while getting back to the player is very snappy - it just jumps from one position to the other. To make the transition smooth i tried this code inside of _process (delta):
$Camera2D.position = lerp($Camera2D.position, $player.position, 0.9)

but still the movement is just snapping from one position to the players position without any transition. I am quiet new to godot and programming in general ... any suggestions?

Thx

in Engine by (27 points)

1 Answer

+1 vote

There is a built-in option just for that.

Under the inspector of a camera2D you can find Smoothing.

enter image description here

by (376 points)

thx a lot! that helped :)

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.