Camera breaks when I reload the scene #548
|
I'm using a 3D camera and everything works fine when I first load up my scene. But if I click "new game" which completely reloads the current scene (including all camera objects and the follow target), the camera no longer follows the target. I see that "_active_pcam_missing" is being set to 'true' and the "_active_pcam_3d" is losing its reference to the phantom_camera_3d node when I reload the scene. I can sort of force it to work again by manually calling "phantom_camera_host._assign_new_active_pcam(phantom_camera_3d)", but this has the unintended opposite effect of making the camera not work initially when I load the game, and it only starts working after I click "new game". So, right now, I can either chose that the camera works initially but breaks later, or starts broken and only works after a reload. What am I doing wrong? |
Replies: 2 comments 3 replies
|
The issue is resolved. The problem was my scene was getting duplicated by using queue_free() instead of free(), so for a single frame there were two copies of everything, and I guess this confused the addon. Now everything reloads correctly. Sorry to trouble you with my mistake! |
|
I had the same problem and had problems with removing my level with free() instead of queue_free() as some object was locked at this time. I made a workaround after deleting the old level with: |
The issue is resolved. The problem was my scene was getting duplicated by using queue_free() instead of free(), so for a single frame there were two copies of everything, and I guess this confused the addon. Now everything reloads correctly. Sorry to trouble you with my mistake!