How to make a Custom Position_Smoothing_Speed?

Godot Version



I’m using position_smoothing_speed on a camera to make it move well in a 2D platformer. When the player is falling from a high distance, I want the camera to move quicker on the y axis to see a little below the player.

The only way I’ve found to do this is by increasing the smoothing speed on the camera, so it can keep up with the player. But when I do that, the x axis is way too quick.

It doesn’t seem like position_smoothing_speed can have a different speed on the x-axis vs the y-axis. So does anyone know how I can make a custom position_smoothing_speed in GDscript that can be different on each axis?

I know there may be other ways to get a smooth camera, but the camera I’m using is already perfect on the x-axis. I just need it to also work when the player is falling quickly.

try add y offset to the camera, can use tween when you know the player is falling from high distance

1 Like