#Searching in a different Scene from the current Scene a Script that is Instanced

1 messages · Page 1 of 1 (latest)

pastel badge
#

I want to reference a GameManager script from a different Scene (Level 1) in my Main Menu Scene. Each level has it's own instance of GameManager with different variables so Don'tDestroyOnLoad won't work from my understanding as I wouldnt want one scenes Gamemanger script being used as the Gamemanager script in a different scene. I tried having a Scene variable and doing FindObjectOfType on it but FindObjectOfType isn't a method useable on a Scene variable. It seems it only looks inside the current scene.

jolly kindle
#

findobjectoftype works in all scenes 🤔

#

ideally you wouldn't want a gamemanager in your main scene and one in each level

#

you might want 1x GameManager existing in DDOL as a Singleton and then some kind of LevelController that exists per level

leaden hedge
pastel badge
pastel badge
pastel badge
leaden hedge