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
  3. Dismiss Notice

Question How do I prevent rendering for 1 frame, and have my game show the last camera's render?

Discussion in 'Scripting' started by mikelowefedex, May 24, 2024.

  1. mikelowefedex

    mikelowefedex

    Joined:
    Sep 29, 2020
    Posts:
    150
    Hello,
    I was wondering if there is a certain code in c# where if the code is placed in any script that is currently running, the game will not render the current frame, but will render the last frame of the game where the line of code isn't processed..

    I have a scenario where I have a mansion with endless rooms, and when I change rooms, a whole bunch of game objects have to process and move around (to produce the next room). I don't want the players to see the game objects process as the next room is developing, and would like to skip that part of the rendering, to where the graphics of the game pauses until the next room is finished processing. Also, turning off the physics and other features until then would be nice too. How would I do this, but more preferably with the graphics?

    Thank you,
    Michael S. Lowe
     
  2. POOKSHANK

    POOKSHANK

    Joined:
    Feb 8, 2022
    Posts:
    382
    you don't want to go about it this way. any visuals repeating for multiple frames during player input will feel like terrible lag. i would recommend just not letting the door open until all your objects are spawned or activated, or having the door animation play while things load. ex: bioshock does this with bulkhead doors