Switching scene if the player is at a certain position after certain time

Hi All,
I am currently developing my first VR interactive experience where audience can explore two simultaneously existing realities - one visually representing a “real” home in Australia made out of point cloud (scene 1), and the other one representing “memory” where I blended audio/visual data from my family home and created an altered version of the apartment (scene 2).

I’m a beginner when it comes to all things Unity/coding/VR and I need an advice on how to tackle one particular part of the experience.

I have 2 scenes - one representing reality (a regular point cloud of an apartment) and another one where I used VFX graph to alter the same point cloud and sounds from Croatia.
I want the player to trigger switching scenes (from scene 1 to scene 2) but only if he is at a certain position X at a certain time (or let’s say 200seconds from the start of the scene 1). It’s important that the player spawns at a position X’ in scene 2 and not just anywhere.

Any advice on how to approach this?

Appreciate the help :slight_smile: Thanks!:slight_smile:

Store a vector to hold the point they must be within. In update use a conditional, an if statement, to check if the player is within a reasonable distance of that point with Vector3.Distance. If you have a time system in place you can add that to the conditional or create one by using a float to count time in Update and add the check to your conditional, or flip a boolean to add to the conditional.

if(Vector3.Distance(player, point) < 1 && timePassed)
{
    //Change scene.
}

Hey @adehm , thanks for this!
I’ve managed to solve this with your idea, the only difference is that I created objects/areas which are scene triggers that appear after certain time.