However, if the player is teleported to Scene B again at this point, the entire game will black out and crash.
I have tested this several times in my own project, and the issue always occurs.
It’s just a simple teleportation feature, so I wonder if anyone else has encountered this problem?
Update: I have already found the cause.
The crash is triggered when a camera’s tracking target is set to “Maintain State at End of Scene.”
My scenes have two cameras, each tracking different objects, with the active camera selected via a portal variable.
Having multiple cameras tracking different objects, where those objects are set to “Maintain State at End of Scene,” triggers this issue.
Thanks for the reply, baz. I’ve noticed that sometimes after I update content on the forum, the translated version doesn’t get updated accordingly. This causes users of other languages to still see outdated information in the translated version. I hope the forum can optimize this.
In the latest update, I explained the issue in detail.
I believe the problem is due to my own design choices.
As you know, in my game, the camera doesn’t follow the player directly; instead, it tracks a dedicated object to enable smooth camera movements.
In Scene B, there are two cameras (Camera 0 and Camera 1), each tracking a different object.
In Scene A, a variable is used to determine which camera should be used after teleportation, based on the portal interaction.
When moving from Scene A to Scene B and selecting Camera 1, then returning to Scene A via another portal, Scene A only has one camera. However, the variable isn’t reset back to Camera 0. Since Scene A doesn’t have a Camera 1, attempting to go back to Scene B afterward causes a conflict, leading to a crash (this is my hypothesis for the cause).