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

Sdílet
Vložit
  • čas přidán 29. 08. 2024

Komentáře • 53

  • @h-hexdeveloper
    @h-hexdeveloper Před 6 měsíci +9

    the serializable scene part was a GODSEND

  • @kruth6663
    @kruth6663 Před 10 měsíci +4

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

  • @Aaron-vn5fd
    @Aaron-vn5fd Před 10 měsíci +6

    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!

  • @user-yh9vg7yc1n
    @user-yh9vg7yc1n Před 5 měsíci +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!

  • @kristophsams5036
    @kristophsams5036 Před 7 měsíci

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

  • @Vav97
    @Vav97 Před 9 měsíci

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

  • @omar-0082
    @omar-0082 Před 26 dny

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

  • @midniteoilsoftware
    @midniteoilsoftware Před 10 měsíci +1

    Great topic and fantastic presentation!

  • @fireraccoon_
    @fireraccoon_ Před 10 měsíci +1

    as always high five for video!

  • @Slagemer1
    @Slagemer1 Před 3 měsíci

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

  • @dong8912
    @dong8912 Před 5 měsíci +1

    3:07 I love it.

  • @BirdtekGames
    @BirdtekGames Před 10 měsíci +1

    This is a great tutorial! A+++

  • @denn501
    @denn501 Před 7 měsíci

    This is mindblowing!!!!!

  • @tinalava68
    @tinalava68 Před 5 měsíci

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

  • @Seshua87
    @Seshua87 Před 10 měsíci +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 Před 4 měsíci +1

      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.

  • @tdr7481
    @tdr7481 Před 10 měsíci

    Really helpful. Thanks!

  • @92LuisAlfredo
    @92LuisAlfredo Před 7 měsíci

    What an amazing video

  • @MarushiaDark316
    @MarushiaDark316 Před 7 měsíci

    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).

  • @sealsharp
    @sealsharp Před 10 měsíci +7

    Algorithm boosting comment goes beeeep.

    • @mmmMindo
      @mmmMindo Před 10 měsíci

      *Bem bop bep bop*
      boost successfull

  • @t33h33studio
    @t33h33studio Před 22 dny

    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?

  • @rainwingp
    @rainwingp Před 3 měsíci

    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.

  • @daezel
    @daezel Před 8 měsíci +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....

  • @Scalpelboy444
    @Scalpelboy444 Před 8 dny

    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

  • @user-uq5li3wc4y
    @user-uq5li3wc4y Před 3 měsíci

    Thank you very much!

  • @BonelesswithalittlesideofJuan

    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

  • @PeeWee1476
    @PeeWee1476 Před 4 měsíci

    This rules. Thank you!

  • @TheOriginalDarkGlitch

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

  • @ForgeAndFortuneVR
    @ForgeAndFortuneVR Před 7 měsíci

    Thank you!

  • @williamducar4642
    @williamducar4642 Před 10 měsíci +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)?

  • @yuukiasuna3739
    @yuukiasuna3739 Před 9 měsíci

    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 Před 9 měsíci +1

      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 Před 9 měsíci

      Ohhh, ok, thank you @@sgtrice1

  • @SmartLearningAI
    @SmartLearningAI Před 4 měsíci

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

  • @patek2385
    @patek2385 Před 9 měsíci

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

  • @ProfDrHawkins
    @ProfDrHawkins Před 10 měsíci

    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 Před 9 měsíci

      A Scene variable type cannot be set in the inspector.

  • @STARmod
    @STARmod Před 10 měsíci

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

  • @Bigblackhawk123
    @Bigblackhawk123 Před 11 dny

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

  • @Nashfanfl13
    @Nashfanfl13 Před 10 měsíci

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

  • @outoftime9071
    @outoftime9071 Před 4 měsíci

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

    • @phoenixfire6559
      @phoenixfire6559 Před 8 dny

      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.

  • @mher_22
    @mher_22 Před 2 dny +1

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

  • @noobdev6464
    @noobdev6464 Před 8 měsíci

    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 Před 4 měsíci

      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?

  • @minima_studios
    @minima_studios Před 10 měsíci

    yes

  • @nojram1604
    @nojram1604 Před 6 měsíci

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

  • @codered_dev
    @codered_dev Před 10 měsíci

    Yooooo

  • @Coco-gg5vp
    @Coco-gg5vp Před 10 měsíci +3

    First

  • @smackmybiatch
    @smackmybiatch Před 7 měsíci

    I wonder why is this not the default for handling global stuff instead of the whacky "DontDestroyOnLoad"