Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to scene change without stuttering (VR)?

Discussion in 'VR' started by Ashwin_Deepak, May 4, 2023.

  1. Ashwin_Deepak

    Ashwin_Deepak

    Joined:
    May 17, 2022
    Posts:
    23
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,214
    Where is the scene transition?
    I did see some stutter, but do not see any scene reloading.
    Can you share the relevant code as well?
    Did you already profile the build?
     
  3. Ashwin_Deepak

    Ashwin_Deepak

    Joined:
    May 17, 2022
    Posts:
    23
    That sudden stutter is scene changing (sorry no transition), i dont want any transition but is it possible to load the scene such that the before scene wont freeze...

    Did you already profile the build? I didnt understand by this
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,214
    1. Share the code you use
    2. With a debug build you can check the performance stats in the profiler, to see exactly what causes the issue
     
  5. jeffries7

    jeffries7

    Joined:
    Jun 25, 2014
    Posts:
    57
    You want to look in Unity's Addressable system and use that for scene loading. It allows you to load scenes (and assets) without blocking the main thread (which is what causes your stuttering).

    The Addressable system is what you would use if you had a massive environment and wanted to load parts of the map dynamically as you reach them. This removes stuttering when loading new environments and generally speeds up initial load times.
     
  6. Ashwin_Deepak

    Ashwin_Deepak

    Joined:
    May 17, 2022
    Posts:
    23
    Thanks let me have a look on it....
     
  7. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    48
    1. If possible, do scene loading on a faded screen, so any stutter is not visible to the user.
    2. If you have to load parts of an open world, use SceneManager.LoadAsync to load those scenes additively, use small chunk scenes and make sure there's not much initialization code, like Awake or Start calls on objects in those scenes.
     
  8. Halfspacer

    Halfspacer

    Joined:
    Sep 13, 2014
    Posts:
    22
    Also going to chime in to recommend setting
    Code (CSharp):
    1. Application.backgroundLoadingPriority = ThreadPriority.Low;
    which will help avoid frame stalls during async calls such as SceneManager.LoadSceneAsync.
     
    TommyTheITGuy likes this.