How to load scenes in the Background for games with HUGE worlds | Unity Tutorial

Поделиться
HTML-код
  • Опубликовано: 23 янв 2025

Комментарии • 60

  • @h-hexdeveloper
    @h-hexdeveloper 11 месяцев назад +15

    the serializable scene part was a GODSEND

    • @yaboishadowninja
      @yaboishadowninja 11 месяцев назад

      Fr, I've always wondered how to do that

  • @Aaron-vn5fd
    @Aaron-vn5fd Год назад +7

    Honestly Brandon, I have been looking for some good info on this topic for several days now. This video is right on time man! Can't thank you enough!

  • @PaalAas
    @PaalAas 10 месяцев назад +1

    Thank you so much for this! I also just did your Hollow Knight camera tutorial a few weeks ago, and was also very impresed. I hope you keep on making these as they are extreamly helpfull!

  • @kruth6663
    @kruth6663 Год назад +4

    The're not enough tutorials on this topic, thank you.

  • @kristophsams5036
    @kristophsams5036 Год назад

    I have been looking for an example to this for some time now, almost a year. Thank you for making this.

  • @あれくす
    @あれくす 5 дней назад +1

    My mind is exploding right now, sir.

  • @Vav97
    @Vav97 Год назад

    Finally found a great tutorial on additive scene loading! Thank you!

  • @frostbyte-64
    @frostbyte-64 4 месяца назад +1

    making a hollow knight inspired game
    wanted to make a room loading system
    and i found what i wanted
    you saved my life

  • @omar-0082
    @omar-0082 5 месяцев назад

    i was just looking to how use the loadScene and found you video, thank you so much !

  • @midniteoilsoftware
    @midniteoilsoftware Год назад +1

    Great topic and fantastic presentation!

  • @fireraccoon_
    @fireraccoon_ Год назад +1

    as always high five for video!

  • @tinalava68
    @tinalava68 10 месяцев назад

    Thanks! Each time I wonder how to do stuff the correct way, you have the answers.

  • @BirdtekGames
    @BirdtekGames Год назад +1

    This is a great tutorial! A+++

  • @dong8912
    @dong8912 10 месяцев назад +2

    3:07 I love it.

  • @MarushiaDark316
    @MarushiaDark316 Год назад

    Would be interested to see this work with event channels, wherein the SO has a SceneField but also information about whether to call a loading screen, and what mode to load (additive or replace).

  • @denn501
    @denn501 Год назад

    This is mindblowing!!!!!

  • @daezel
    @daezel Год назад +1

    Hello. I've seen your other video with a panning camera automatically with trigger colliders. I was wondering if implementing both features might create collider hell and lead to lag. as far as I know, collision detection is pretty computationally heavy....

  • @SmartLearningAI
    @SmartLearningAI 9 месяцев назад +1

    How would you handle this in larger open-world scenes?

  • @Axx00-x0
    @Axx00-x0 2 дня назад

    Is this like occulsion culling but 2D?

  • @tdr7481
    @tdr7481 Год назад

    Really helpful. Thanks!

  • @frostbyte-64
    @frostbyte-64 2 месяца назад

    how do you make the background infinite?

  • @Seshua87
    @Seshua87 Год назад +5

    This is helpful, One question, only asking because I'm not currently in Unity, When setting up a scene that comes after a previous scene, lets say in scene 1 the edge of that scene is at 50 on the x position, In the scene next to it (to the right) would that scene's edge block have to start at 50 on the x?

    • @limear
      @limear 9 месяцев назад +2

      1. Create a new empty game object and move it to the new scene using SceneManager.MoveGameObjectToScene.
      2. Set that game object as a parent to all root game objects using Scene.GetRootGameObjects and Transform.SetParent.
      3. Set transform.position of the parent object to the "anchor point" at the seam between the 2 scenes. I use empty game objects to set the anchor point position in the scene.
      You probably figured this out in 6 months but maybe someone will find this useful.

  • @Scalpelboy444
    @Scalpelboy444 5 месяцев назад

    I tried this in a 3d game but the different lighting of the other scene (day) brightens the scene of the first scene (night) any way to fix this? sorry total noob here

  • @92LuisAlfredo
    @92LuisAlfredo Год назад

    What an amazing video

  • @chadm6777
    @chadm6777 4 месяца назад

    How would one handle AI in this context? You won't want them doing nothing while the player's in another region of the game world, but also don't want to render AI transforms, textures, audio etc. when not in range of the player.

  • @Slagemer1
    @Slagemer1 8 месяцев назад

    Gosh you are fcking quick, unreal to follow your mind, so rapid, im burning

  • @williamducar4642
    @williamducar4642 Год назад +1

    Appreciate the video. What is the difference between the loading and unloading scenes to create a large world versus enabling and disabling addressables (via the Addressable Asset System)?

  • @noobdev6464
    @noobdev6464 Год назад

    Great tutorial, but i have an issue, i have a paralax script who is refering a game object in my first room called environment ( where all the paralax layers are for my environment) on room 1, but when i unload room 1 my camera ca no longer find the reference of the game object environment. Anyone know how to fix this ?

    • @mrroams5812
      @mrroams5812 9 месяцев назад

      I know this is an old comment, but you'll have to find a way to dynamically find the new environment object. Maybe mark the environment object with a "environment" tag and then search for the new environment object/s when you load a new level using that tag?

  • @ДосталиЕвский
    @ДосталиЕвский 8 месяцев назад

    Thank you very much!

  • @BonelesswithalittlesideofJuan
    @BonelesswithalittlesideofJuan 9 месяцев назад

    I’ve been trying to implement this type of architecture in my game, and this video ended up being really helpful thanks! Just one question tho, how did you make that the scenes started at a different position. How specifically does the red platform starts at the edge of the gray one and so forth

  • @t33h33studio
    @t33h33studio 5 месяцев назад

    So I guess you just have to change where you place "new scenes" transforms that are part of a seamless world to be in reference from position 0,0,0?
    Otherwise wouldnt loading another scene accidentally loading over an existing part of your world? Like two different platforms fighting for the position of Vector3(4.5 , 11 , 0)
    Its easy to imagine playing through a world like that, but i find it hard to imagine/envisioning Editing those scenes without frustration. Would that need its own boiler plate code to aid in Editing scenes?

  • @TheOriginalDarkGlitch
    @TheOriginalDarkGlitch 4 месяца назад

    I just started experimenting with multiple scenes and that SceneField script needs to be standard.

  • @outoftime9071
    @outoftime9071 9 месяцев назад

    I don't get how it works in reverse too as in going back through the level. Can someone explain please?

    • @phoenixfire6559
      @phoenixfire6559 5 месяцев назад

      There is no need for a direction for the trigger. Think about it, if you hit the trigger then at the given point in time you only need the scenes around it loaded. It doesn't matter if you hit it from the left or right. When you hit a different trigger, the scenes loaded will change.
      Example:
      I have three rooms in a row.
      Room 1 - - - - Room 2 - - - - Room3
      The triggers do the following:
      Room 1 trigger => Loads Rooms 1 and 2. Unloads Room 3.
      Room 2 trigger => Loads Rooms 1, 2 and 3.
      Room 3 trigger => Loads Room 2 and 3. Unloads Room 1.
      I am in Room 1 so Room 1 and 2 are loaded. I go to Room 2 so Room 1, 2 and 3 are loaded. I go to Room 3 which unloads Room 1. I got back to Room 2 which again loads all three rooms.
      The first instance I went into Room 2 from the left, the second from the right. It didn't matter which way I approached the trigger.

  • @ForgeAndFortuneVR
    @ForgeAndFortuneVR Год назад

    Thank you!

  • @STARmod
    @STARmod Год назад

    Make a video on adressables for the same usecase, no one ever made a video for that

  • @KurzGuy
    @KurzGuy 23 дня назад

    what about 3d

  • @PeeWee1476
    @PeeWee1476 9 месяцев назад

    This rules. Thank you!

  • @yuukiasuna3739
    @yuukiasuna3739 Год назад

    Hi @Sasquatch B Studios, I really learn a lot through this tutorial! I a bit confuse about the persistentGameplay section. How do you keep the player to stay in each level in the video? Is my concept correct: Loaded once from StartGame(Main Menu) and then it will load continuously as it is in Async and also because it is not set unload in SceneLoadTrigger?

    • @sgtrice1
      @sgtrice1 Год назад +2

      Correct, PersistentGameplay scene is loaded once at start and never unloaded until the game is stopped. Any thing you need to keep alive the entire game you place in this scene.

    • @yuukiasuna3739
      @yuukiasuna3739 Год назад

      Ohhh, ok, thank you @@sgtrice1

  • @Nashfanfl13
    @Nashfanfl13 Год назад

    veil of maia is that game still being worked on? haven't seen a dev log in a while

  • @ProfDrHawkins
    @ProfDrHawkins Год назад

    Just a quick question: Why can't we use Scene as variable type for a scene and rely on a custom SceneField type, if we don't want to use strings for our scenes? Like you did create scene variables in the load and unload methods of the trigger script.

    • @sgtrice1
      @sgtrice1 Год назад

      A Scene variable type cannot be set in the inspector.

  • @sealsharp
    @sealsharp Год назад +7

    Algorithm boosting comment goes beeeep.

    • @mmmMindo
      @mmmMindo Год назад

      *Bem bop bep bop*
      boost successfull

  • @nojram1604
    @nojram1604 11 месяцев назад

    Now I know that there is a serializable scene. I wish I knew early...

  • @BIGBLACKHAWK123
    @BIGBLACKHAWK123 5 месяцев назад

    This… did not work. It could be a defect in my game exclusively but I tried for hours.

  • @minima_studios
    @minima_studios Год назад

    yes

  • @rainwingp
    @rainwingp 8 месяцев назад

    Thank you for this tutorial!! but I have a question in my mind. How should I use cross-scene reference with my player, controlManager and other objects? I can't drag objects from the persistentGameplay scene into the scripts field of the Room scene.

  • @patek2385
    @patek2385 Год назад

    So when the player is on a different scene, can we simply drag and drop him to the scripts from another scene?

  • @PheonixWrong0
    @PheonixWrong0 5 месяцев назад +1

    I can't understand what's going on here, he's going too fast :(

  • @codered_dev2
    @codered_dev2 Год назад

    Yooooo

  • @Coco-gg5vp
    @Coco-gg5vp Год назад +3

    First