Reply To: Chapter 11-12 Code issue

Home Forums Books Mastering Unity 2D Game Development Chapter 11-12 Code issue Reply To: Chapter 11-12 Code issue

#5094

Right, found the issue.

In the sample code an instance of “MessagingManager” has been added to the “MainMenu” scene by default somehow.

As the type of singletons used in the book (programatic singletons), they are not meant to be added this way, so that is what is causing the error. Because it wasn’t created by Singleton, the DontDestroyOnLoad isn’t set, so when the GO is destroyed, it thinks the app is quitting.

To fix, just delete the “MessagingManager” from the “MainMenu” scene and it will run just fine.

 

Unsure how that got into the code download and can only apologise for the confusion there.

Simon (Darkside) Jackson
@SimonDarksideJ