Quick answer: After teleporting the camera’s target, call camera.reset_smoothing() so the camera snaps instead of sliding across the level.
A door warps the player to another room. The Camera2D, with position smoothing on, slides smoothly across the whole level to catch up — a dizzying pan.
reset_smoothing()
func teleport_player(dest: Vector2):
player.global_position = dest
camera.global_position = dest # move camera too
camera.reset_smoothing() # snap, don't slide
reset_smoothing() instantly moves the smoothed camera to its target, skipping the interpolation.
Temporarily Disable
Alternatively, toggle smoothing around the teleport:
camera.position_smoothing_enabled = false
player.global_position = dest
await get_tree().process_frame
camera.position_smoothing_enabled = true
One frame with smoothing off lets the camera snap, then re-enable.
Camera Limits Caveat
If the destination room has different camera limits, set those before reset_smoothing — otherwise the camera snaps to a position the new limits will then clamp, causing a second jump.
Drag Margins
Drag margins also interpolate. reset_smoothing handles position smoothing; for drag-margin setups, also re-center the target within the margin box on teleport.
Verifying
Walk through the door. The camera is instantly on the new room — no slide. Normal following resumes smoothly afterward.
“Smoothing is for following, not for teleports. reset_smoothing() after every warp.”
Wrap teleport + camera move + reset_smoothing + limit update into one function — call it everywhere, never forget a step.