HOW TO KEEP OBJECTS WHEN CHANGING SCENES IN UNITY - DontDestroyOnLoad

Опубликовано: 17 Март 2026
на канале: BAM GAMES & APPS - Unity Tutorials
193
2

HOW TO KEEP OBJECTS WHEN CHANGING SCENES IN UNITY - DontDestroyOnLoad

This short is an extract of "HOW TO KEEP OBJECTS WHEN CHANGING SCENES IN UNITY - DontDestroyOnLoad", you can watch the full video here:    • HOW TO KEEP OBJECTS WHEN CHANGING SCENES I...  

HOW TO KEEP OBJECTS WHEN CHANGING SCENES IN UNITY - DontDestroyOnLoad | Unity Tutorial

In this NEW Unity tutorial, we are going to learn how to keep objects (don't destroy GameObjects) and their scripts when changing scenes. This will allow us to transfer information from one scene to another easily in Unity.

To do this, we will use the DontDestroyOnLoad method, which will ensure that our GameObject and everything it contains (script, components, etc.) is preserved in all scenes so that its content can be accessed and used.

We will optimize our game by avoiding to declare and initialize the same element or functionality several times in different scenes, such as music management, advertisement management, player data, etc.

We will implement all this based on an additional feature shown in previous unity tutorials:

✅ 🔊 HOW TO ADD MUSIC AND SOUND EFFECTS TO A GAME IN UNITY
   • 🔊 HOW TO ADD MUSIC AND SOUND EFFECTS TO A ...  

I'll explain in detail how to do this and show you all the tips and tricks I know in Unity!!!

Have a nice day Unity developer!

❗️KEEP LEARNING about Unity for beginners or advanced users❗️
   • Unity Tutorials - Free Course