- Home /
Can I add an exemption on DontDestroyOnLoad?
I am currently using DontDestroyOnLoad on my game objects. However, can I add an exemption to this? Like a particular game object will be destroyed?
Answer by Juneyee · Jul 30, 2017 at 11:39 AM
I don't really understand the question...
Any object that you don't add DontDestroyOnLoad to will be removed during the changing of scenes. If you need to control which objects aren't destroyed, just add a script with DontDestroyOnLoad on the Awake function, and attach that script to any gameObject you wish to preserve across scenes.
Follow this Question
Related Questions
How to detect an object which be in FOV of certain camera ? 1 Answer
DontDestory gameobject doesn't work on button click after a new scene loads 2 Answers
GameObject is already being activated or desactivated 2 Answers
How to make an object invisible before it is triggered to show? 2 Answers
Creating a GameObject variable without instantiating it? 1 Answer