Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi everyone, I am working on a project with multiple scenes and I'm having some trouble with the player's position when moving back and forth between them. The setup: I have a Gate (trigger) in Scene A that leads to Scene B using the "Switch to another scene" action. In Scene B, I have another Gate to go back to Scene A. The problem: When I return to Scene A, the Camera is not at the initial starting point, but it seems to "remember" the last position it had before leaving the scene (which is exactly inside the exit trigger). This creates a loop or leaves the player stuck in the doorway. What I need help with: What is the best way to "teleport" the Camera to a specific spawn point only when returning from a specific scene? I've heard about using a global variable (like ComingFromScene2 = 1) and checking it "When a scene is started" to move the camera node. Is this the most efficient method, or is there a way to completely reset a scene's state when re-entering it? Please explain me step by step what to do Thanks in advance for any advice! |
||||
|
I believe, the simplest way would be to do it with a short script. // switch to another scene You can put those with different parameters right into "Execute javascript" block, or can create a custom action, expose the parameters and reuse it across the game. Basically, you just use this script in place of "Switch to Scene" action. |
||||
|
Thak you, it worked! |
||||
|
|