- Edited
I'm creating a 2D game where I want the user to move between upper and lower areas in the scene. The upper and lower layers have different collision layers and different ySort groups to manage the PC and NPCs on that layer. When my PC enters an Area2D, I have a script that changes its parent from the first ySort group to the second one and changes it's collision mask. Since the two ySort groups have their translations set to 0, this does not result in my PC visibly on the screen.
I have a Camera2D which is set as a child to my PC. When my PC is moved from the first ySort group to the second, while this does not cause the PC to move in world space at all the camera none the less has a noticable jump to the side of about 20 pixels. If I move my character over to another Area2D that moves it back to the original ySort group, the camera shifts back to its original offset. I have no idea why this is happening since the world space position of my character is not changing.
How do I get my camera to stop jumping?
-- Edit: I noticed that if I turn off smoothing and put the drag margin to 0 then most of the jumping is eliminated. Still, it would be nice to not have to disable these features.