I am doing something similar to old school Zelda, where you walk through a door, generate a new room, then transition/pan the camera over to the new room.
Everything works perfectly, except occationally I get an initial jump in the camera movement. I think (not certain though) that this is because there is a ton of code that needs to be executed, lots of objects to be generated, etc. and I am also simultaneously moving the camera to the center of the new room at this point.
It is crucial that I get a very smooth transition with the camera. It would be acceptable to even have a slight delay to make sure all of the heavy lifting is done prior to starting to move the camera.
Is there a good method for doing this? Is this as simple as putting something like a frame counter at the end of all of that code? For example at the end of the code execution, I set frame counter to 1. On the next frame I increment it again to 2. I then don’t start to move the camera until the frame counter equals 2. If there was a delay and it messed with the frame rate, it would only effect frame 1 and 2, and not the camera movement right? Is this a correct way of doing it or is there a better way?
Thanks and any help or advice is greatly appreciated!