Scene Attributes

Hi Guys
I want to do the following : when the user clicks on a certain spot I want to switch to a new scene - however the “old” send shoul hand over some attributes to the new scene.
How would that be done ? Or is this generally achived in a different way ?

I personally did not check, but the forum has already raised a similar question. Try to do as described here: Keep same score variable in all scenes

1 Like

that should perfectly work - thanks a lot. although I hoped there was a more “object oriented way” :slight_smile:

There are a few ways. One is the classic of having a global JS object/variable to store the values.
As shown in the thread linked above.

You could also create a scene loading manager/script that not only handles the scene loads/unloads but can also pass data between scenes.

It depends on how these scenes are intended to be used. Should they be able to work independently? Or is one very dependent on the other?

1 Like

Thanks - I guess a scene loader would then be the cleanest way to go.
I intend to do some overview->details relationship.
So you pick one object from an overview ‘map’ and the next scene should show this object in details - so I want to pass this object.
However I will have different ObjectTypes and thus different scenesTypes that need to be instanciated - depending on what objectType the user clicked on

In our Unity project we have a similar problem and use a global scene manager to handle this. It’s basically a global with a nice wrapper but it does allow us to load each scene independently and ‘inject’ known data for testing the scene in isolation/very debug commands etc

1 Like

Makes sense. sounds like the way i should go. thanks