I have a Camera2D node following my player with both position smoothing and limit smoothed enabled. However, when the scene starts or changes, the camera is offset from its target position before moving there in a way that looks really awkward.

Here are some examples of others having the same issue:
https://github.com/godotengine/godot/issues/56336

I've tried every solution that I could find suggested online: calling reset_smoothing(), calling force_update_scroll() and then reset_smoothing(), disabling limit_smoothed then updating the position before enabling limit_smoothed again, temporarily disabling limit_smoothed and then calling reset_smoothing()... It's driving me mad!

  • Isaac likes this.
  • Nevermind, I figured it out myself.

    I have a global LevelManager script that emits the level_change_started signal when the player enters a transition area and a level_loaded signal after the new scene is loaded and the fade animation is finished. Then I connected the level_change_started signal to the following function in my player camera script:

    func level_change_started() -> void:
    position_smoothing_enabled = false
    limit_smoothed = false
    await LevelManager.level_loaded
    position_smoothing_enabled = true
    limit_smoothed = true
    force_update_scroll()
    reset_smoothing()
    reset_smoothing()

    I also call a similar procedure in the camera's ready function, but I replaced the LevelManager.level_loaded signal with the get_tree().process_frame signal.

Nevermind, I figured it out myself.

I have a global LevelManager script that emits the level_change_started signal when the player enters a transition area and a level_loaded signal after the new scene is loaded and the fade animation is finished. Then I connected the level_change_started signal to the following function in my player camera script:

func level_change_started() -> void:
position_smoothing_enabled = false
limit_smoothed = false
await LevelManager.level_loaded
position_smoothing_enabled = true
limit_smoothed = true
force_update_scroll()
reset_smoothing()
reset_smoothing()

I also call a similar procedure in the camera's ready function, but I replaced the LevelManager.level_loaded signal with the get_tree().process_frame signal.