Unity Scenes 2: Keeping Objects When Changing Scenes (DontDestroyOnLoad)

Опубликовано: 12 Октябрь 2024
на канале: Unity Videos (Julien Lynge)
35,504
398

How to keep objects from being unloaded when loading a new scene.

Note: this video was made before Unity started showing DontDestroyOnLoad objects separately in the hierarchy, which is why this looks a bit different than what you see in the editor. Everything discussed here is still valid, but now you don't need to check the GameObject's scene property to see which scene it's in.