Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    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:
    24
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,127
    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:
    24
    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:
    5,127
    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:
    60
    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:
    24
    Thanks let me have a look on it....
     
  7. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    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:
    23
    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.