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

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ม.ค. 2025

ความคิดเห็น • 58

  • @h-hexdeveloper
    @h-hexdeveloper 11 หลายเดือนก่อน +14

    the serializable scene part was a GODSEND

    • @yaboishadowninja
      @yaboishadowninja 11 หลายเดือนก่อน

      Fr, I've always wondered how to do that

  • @kruth6663
    @kruth6663 ปีที่แล้ว +4

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

  • @Aaron-vn5fd
    @Aaron-vn5fd ปีที่แล้ว +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!

  • @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!

  • @kristophsams5036
    @kristophsams5036 11 หลายเดือนก่อน

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

  • @Vav97
    @Vav97 ปีที่แล้ว

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

  • @frostbyte-64
    @frostbyte-64 3 หลายเดือนก่อน +1

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

  • @midniteoilsoftware
    @midniteoilsoftware ปีที่แล้ว +1

    Great topic and fantastic presentation!

  • @omar-0082
    @omar-0082 5 หลายเดือนก่อน

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

  • @fireraccoon_
    @fireraccoon_ ปีที่แล้ว +1

    as always high five for video!

  • @BirdtekGames
    @BirdtekGames ปีที่แล้ว +1

    This is a great tutorial! A+++

  • @denn501
    @denn501 11 หลายเดือนก่อน

    This is mindblowing!!!!!

  • @tdr7481
    @tdr7481 ปีที่แล้ว

    Really helpful. Thanks!

  • @92LuisAlfredo
    @92LuisAlfredo 11 หลายเดือนก่อน

    What an amazing video

  • @dong8912
    @dong8912 10 หลายเดือนก่อน +2

    3:07 I love it.

  • @tinalava68
    @tinalava68 10 หลายเดือนก่อน

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

  • @MarushiaDark316
    @MarushiaDark316 11 หลายเดือนก่อน

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

  • @ДосталиЕвский
    @ДосталиЕвский 7 หลายเดือนก่อน

    Thank you very much!

  • @Slagemer1
    @Slagemer1 7 หลายเดือนก่อน

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

  • @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 8 หลายเดือนก่อน +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.

  • @ForgeAndFortuneVR
    @ForgeAndFortuneVR 11 หลายเดือนก่อน

    Thank you!

  • @PeeWee1476
    @PeeWee1476 9 หลายเดือนก่อน

    This rules. Thank you!

  • @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....

  • @t33h33studio
    @t33h33studio 4 หลายเดือนก่อน

    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?

  • @sealsharp
    @sealsharp ปีที่แล้ว +7

    Algorithm boosting comment goes beeeep.

    • @mmmMindo
      @mmmMindo ปีที่แล้ว

      *Bem bop bep bop*
      boost successfull

  • @SmartLearningAI
    @SmartLearningAI 8 หลายเดือนก่อน +1

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

  • @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)?

  • @BonelesswithalittlesideofJuan
    @BonelesswithalittlesideofJuan 8 หลายเดือนก่อน

    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

  • @STARmod
    @STARmod ปีที่แล้ว

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

  • @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

  • @chadm6777
    @chadm6777 3 หลายเดือนก่อน

    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.

  • @TheOriginalDarkGlitch
    @TheOriginalDarkGlitch 4 หลายเดือนก่อน

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

  • @frostbyte-64
    @frostbyte-64 หลายเดือนก่อน

    how do you make the background infinite?

  • @Scalpelboy444
    @Scalpelboy444 4 หลายเดือนก่อน

    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

  • @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.

  • @Nashfanfl13
    @Nashfanfl13 ปีที่แล้ว

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

  • @KurzGuy
    @KurzGuy 2 วันที่ผ่านมา

    what about 3d

  • @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 8 หลายเดือนก่อน

      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?

  • @nojram1604
    @nojram1604 10 หลายเดือนก่อน

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

  • @outoftime9071
    @outoftime9071 8 หลายเดือนก่อน

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

    • @phoenixfire6559
      @phoenixfire6559 4 หลายเดือนก่อน

      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.

  • @BIGBLACKHAWK123
    @BIGBLACKHAWK123 4 หลายเดือนก่อน

    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 7 หลายเดือนก่อน

    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.

  • @PhoenixWrong0
    @PhoenixWrong0 4 หลายเดือนก่อน +1

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

  • @patek2385
    @patek2385 ปีที่แล้ว

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

  • @codered_dev2
    @codered_dev2 ปีที่แล้ว

    Yooooo

  • @Coco-gg5vp
    @Coco-gg5vp ปีที่แล้ว +3

    First