# Scene switching noob question

**URL:** <https://forum.defold.com/t/scene-switching-noob-question/67058>\
**Category:** Questions\
**Created:** [December 20, 2020, 12:52pm UTC](https://forum.defold.com/t/scene-switching-noob-question/67058 "2020-12-20T12:52:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdavid82](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jdavid82/32/23015_2.png) [@jdavid82](https://forum.defold.com/u/jdavid82)\
**Post date:** [December 20, 2020, 12:52pm UTC](https://forum.defold.com/t/scene-switching-noob-question/67058/1 "2020-12-20T12:52:38Z")

</div>

Hi,

I installed Defold today, checked out the sample projects, completed the War battles tutorial, made more changes, played it on the browser with my xbox controller after deploying it to a local web server, it was easier than I thought, I’m so exited about this engine.

Anyway, I need to understand the basic concepts of scene transition similar to the ones that take place in the Colorslide tutorial (which revolves around collection proxies).

My problem is… I think I attempted this tutorial too soon, because even if I manage to get it to work (the back button currently doesn’t work), I still don’t think I’d understand what is really going on because I was too busy coding animations, creating gui files, gui scripts, changing other scripts, deleting code that I thought was needed… all of it as part of this particular tutorial, during my first day of working with Defold…

My question is, are there any other tutorials or any other samples that show me the basics of scene transition?  
I don’t mind if each scene just has a label and a button.

Sorry I don’t want to criticize, I appreciate the effort taken for preparing these tutorials, it’s just that it’s late here in Australia and this is probably a sign for me to head to bed and try again tomorrow.

Thanks in advance for any help.

Cheers!

---

<div class="post-metadata">

**Author:** ![Dat\_Indie](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/dat_indie/32/18548_2.png) [@Dat\_Indie](https://forum.defold.com/u/Dat_Indie)\
**Post date:** [December 20, 2020, 7:48pm UTC](https://forum.defold.com/t/scene-switching-noob-question/67058/2 "2020-12-20T19:48:09Z")

</div>

Welcome!  
I had the same problem undestanding the messages to load, enable and unload a collection. But it’s super simple! First read the Defold Collection proxy manual: [Collection proxy manual](https://defold.com/manuals/collection-proxy/)  
then you can check an example (called “Menu and Game”) on [Britzl’s public examples](https://britzl.github.io/publicexamples/)

Have a nice one!

---

<div class="post-metadata">

**Author:** ![jdavid82](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jdavid82/32/23015_2.png) [@jdavid82](https://forum.defold.com/u/jdavid82)\
**Post date:** [December 20, 2020, 9:05pm UTC](https://forum.defold.com/t/scene-switching-noob-question/67058/3 "2020-12-20T21:05:04Z")

</div>

Brilliant!!  
Thank you very much Alex

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 20, 2020, 9:58pm UTC](https://forum.defold.com/t/scene-switching-noob-question/67058/4 "2020-12-20T21:58:06Z")

</div>

Welcome @jdavid82!

Just like @Dat_Indie correctly points out screen/scene transitions are usually handled by loading and unloading collections via collection proxies. The screens/scenes could also be spawned and removed using collection factories, but I think it is most common to load/unload using collection proxies.

There are assets which can help you with this. One example is [Monarch](https://github.com/britzl/monarch).

---

<div class="post-metadata">

**Author:** ![jdavid82](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jdavid82/32/23015_2.png) [@jdavid82](https://forum.defold.com/u/jdavid82)\
**Post date:** [December 20, 2020, 10:20pm UTC](https://forum.defold.com/t/scene-switching-noob-question/67058/5 "2020-12-20T22:20:08Z")

</div>

Thank you @britzl.

I’m planning to make a top-down Facebook “instant” game.

I’m currently investigating two things, first _if it’s possible_ to launch the game just with the initial menu screen, then once the player is ready and taps “start match” then download the chosen game scene and unload the previous world (basically avoid loading the whole game at once).

That’s on the network bandwidth side of things, the second thing is regarding the _RAM/memory_ side of things, if I understand correctly it appears that memory could be freed once you unload a scene/world and move on to the next, which is great (I’m still investigating though but I hope that’s the case).

If the Monarch plugin and/or collection proxies are okay for this, or if there are any gotchas for what I’m trying to do, please let me know.

Cheers

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 20, 2020, 10:27pm UTC](https://forum.defold.com/t/scene-switching-noob-question/67058/6 "2020-12-20T22:27:04Z")

</div>

> [@jdavid82](#):
>
> I’m currently investigating two things, first _if it’s possible_ to launch the game just with the initial menu screen, then once the player is ready and taps “start match” then download the chosen game scene and unload the previous world (basically avoid loading the whole game at once).

Yes, this is possible using what we call LiveUpdate where you exclude the content of collection proxies and download and cache those as they are needed.

LiveUpdate: [Live update content in Defold](https://defold.com/manuals/live-update/)  
LiveUpdate for Instant Games: [GitHub - defold/extension-fbinstant: Facebook Instant Games extension for the Defold game engine · GitHub](https://github.com/defold/extension-fbinstant/#facebook-instant-games-and-liveupdate)

I would recommend that you first create the game without the LiveUpdate feature as that makes the workflow simpler (don’t take on too much at once when learning a lot of new things!)

> [@jdavid82](#):
>
> That’s on the network bandwidth side of things, the second thing is regarding the _RAM/memory_ side of things, if I understand correctly it appears that memory could be freed once you unload a scene/world and move on to the next, which is great (I’m still investigating though but I hope that’s the case).

Yes, all resources are reference counted and when you unload a collection via a collection proxy all referenced resources with a ref count of 0 will be removed from memory. You can also control this on a per factory level through the Load Dynamically checkbox on the factory component.

---

<div class="post-metadata">

**Author:** ![jdavid82](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jdavid82/32/23015_2.png) [@jdavid82](https://forum.defold.com/u/jdavid82)\
**Post date:** [December 20, 2020, 10:28pm UTC](https://forum.defold.com/t/scene-switching-noob-question/67058/7 "2020-12-20T22:28:43Z")

</div>

That’s awesome, thank you for the explanation @britzl, hope you have a great day

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 20, 2020, 10:30pm UTC](https://forum.defold.com/t/scene-switching-noob-question/67058/8 "2020-12-20T22:30:03Z")

</div>

> [@jdavid82](#):
>
> That’s awesome, thank you for the explanation

👍

> [@jdavid82](#):
>
> hope you have a great day

Going to bed soon! But thanks! And to you too!
