Hi, I’ve got some code on Awake -right after my singleton pattern- that is responsable for checking if we’re running a gameplay scene or a menu scene. This code goes fine in the first scene but if I’m going from a menu to a gameplay scene the Check doesn’t seem to run at all !
void Awake()
{
if (Instance == null)
{
DontDestroyOnLoad(gameObject);
Instance = this;
}
else if (Instance != this)
{
Destroy(gameObject);
}
isGameplayScene = true;
if (FindObjectOfType<NoGameplayScene>() != null){ // check if the scene is gameplay or menu || loading
isGameplayScene = false;
} else{
isGameplayScene=true;
Do More Stuff
}
}
my isMenu bool stays true and isGameplayScene stays false…
What am I doing wrong ?? ^^’