reactivating a scene?

Hello again, I am just wondering if theirs a way to get around this problem:

I add an overlay scene, then I remove it, but the next time I add that overlay scene I get an error that says it cant load objects because they were freed from memory. Is there a way around this? if you need more info let me know and I’ll get it for you:)

This happens if you access references to non existing objects.

I guess you keep such references to object from the overlay scene somehow.
Ensure you do not do that.

You can for example check if a game object still exist by checking KX_GameObject.invalid before using it.
If it returns True, you ignore it or look for an alternative game object e.g. From new scene.

I hope it helps

Thanks that did, since I only run the script on one object, i just got the controlling object, and then assigned the scene (scene = logic.getCurrentScene()) inside my function, and that fixed it:), I originally had assigned the scene as a global variable, i think this was the root cause of my problem, anyways thanks for the suggestion, it really did help:).