Phazorknight / Cogito

Immersive Sim Template Project for GODOT 4
MIT License
717 stars 81 forks source link

Crash on repeated scene transitions #138

Closed samaritan-sw closed 3 months ago

samaritan-sw commented 3 months ago

A crash happens after repeatedly loading demo scene 4 from scene 5.

Repro steps:

image

The issue seems to be that Cogito is trying to locate a QuestUpdaterA node parented to a Rigidbody that doesn't seem to exist when looked at in the remote inspector:

image

This happens when trying to load state data, so probably an issue with the way the data is saved - or perhaps with the way that particular node is set up? I couldn't get this crash to happen by transitioning between demo scenes 1 and 2, and when transitioning between scenes 4 and 5, scene 4 is always the issue.

Phazorknight commented 3 months ago

Thanks for flagging this! Could you give https://github.com/Phazorknight/Cogito/commit/65be57d0ef58be1db46565f29b9081c126a59fbc a try and see if it solves your issue?

Also, really appreciate the reproduction steps, was able to narrow down the issue quickly thanks to this. The culprit wasn't a particular node, but the fact that QuestUpdater script was set up to save its state to the scene state, which is actually unnecessary.

samaritan-sw commented 3 months ago

That fixed it, thanks! 💪