-
Notifications
You must be signed in to change notification settings - Fork 1
Scene Switching
When switching scenes one must fade the headset to black, load the scene, then unfade the headset to prevent nausea.
To streamline this process, the SceneSwitch
and FadeIn
scripts were created, along with the SceneSwitcher
prefab.
Every scene should contain an instance of this prefab.
By default, the prefab has an instance of the FadeIn
script. Ensure it's Headset Fade
parameter is set to the prefab's child HeadsetFader
prefab.
The FadeIn
script fades the scene into view when it first loads in.
In general, the SceneSwitch
script is a parent class for more specific scene switch triggers, but it can still be used to switch scenes.
Make sure an instance of the script exists somewhere in the scene. (Generally, adding it to the scene's SceneSwitcher
prefab is the best place for it).
Set the scripts Scene Name
parameter to the scene you want this script to switch to. (ex. "LobbyScene").
Set the Headset Fade
parameter to the Headset Fader
prefab under this scene's Scene Switcher
prefab.
To activate the transition to the given scene, call the SceneSwitch
's StartTransition
function in any script.
The DistanceTrigger
script is a specialized version of the SceneSwitch
script.
It automatically transitions to the given scene when the script's parent object gets within a set distance of another object.
Refer to the above section to understand the script's first few parameters.
Set the Compare Transform
field to the transform of the object that this script should compare its distance to.
Set Distance Threshold
to the required distance between the script's parent and the Compare Transform
to initialize the scene transition.