Trying to solve a camera issue where it shows the player in the wrong position for a single frame. Unfortunately, the following approaches did not work:

  • Using _enter_tree, because the spawn point doesn’t exist yet.
  • Loading the scene without switching to it with load, making the change, and then switching to the scene, because the spawn point doesn’t exist yet (_enter_tree and _ready have not been called yet when you instantiate a scene this way)
  • Calling a function to set the camera position from _ready, in case the camera’s position was being updated before the player. This did seem to improve the situation (since the camera is always before the player in the scene view, so I’m guessing we’re now 1 frame behind instead of 2), but it doesn’t fix it.

Maybe the problem is that I’m conflating node existence with registration of the position, and i should change my dictionary to be a map of keys strings to positions instead of strings to nodes. This would at least free me of my dependence on the Node lifecycle.