G
G
Gregory2562021-10-26 19:28:55
C++ / C#
Gregory256, 2021-10-26 19:28:55

How to remove duplicates if object is reserved by DontDestroyOnLoad?

Good day. Help solve the problem: At each level (new scene) I want to leave a pause button and a play menu. At the first level, I threw the DontDestroyOnLoad script onto the canvas. When leaving the level and returning to the level, the canvas is duplicated. How can duplicates be removed? Or is there another way to do this operation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-10-26
@Gregory256

So you don't have to keep the menu in the level scene. Create it from the prefab if it's missing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question