Example project: https://github.com/robrtsql/gamedev-projects/tree/3438188857fbbd475b10e7a1a6acba587fa1c5e3/CameraFollow
Godot 3.0 (built from source on master)
OS: Elementary OS 0.4.1 / Ubuntu (64-bit)
GPU: NVIDIA GeForce GTX 1070
I am troubleshooting an issue where my Camera2D node, which is a child of my sprite, doesn't seem to be following its parent exactly.
My expectation is that, because Camera2D is a child of my Sprite, and the Camera2D's offset is (0,0), then my Sprite should always be drawn in the center of the screen because the Camera2D's position should always match that of the Sprite.
I have found that, when moving my sprite around in the physics process step, everything behaves as expected. (This is reproducible by changing this (https://github.com/robrtsql/gamedev-projects/blob/3438188857fbbd475b10e7a1a6acba587fa1c5e3/CameraFollow/Main.tscn#L13) to true).
However, when I move my sprite around in the regular process() step, the sprite is no longer drawn in the center of the screen.
What's going on? My camera's drag margins are all set to 0, and smoothing is turned off.
I didn't include this script in the example project, but I have included scripts to force the global position of the Camera2D to be equal to that of my Sprite, but even after confirming that their positions are equal, the scene is still drawn in such a way that the Sprite is not guaranteed to be at the center (it visibly moves around).
Is my understanding incorrect? Why doesn't my camera guarantee that my sprite is drawn in the center of the screen, and how can I fix this?