Trying to access gameobjects from other loaded scene

60 Views Asked by At

Basically, i have a player script in DontDestroyOnLoad(), and i have other gameobjects (enemies) that i want to access from the other loaded scene.

        foreach(Enemy enemy in FindObjectsOfType<Enemy>()) {
 //Does stuff here
}

and its not because of something in the enemy class, as i have tried to do the same with a MapVar class, even trying using singletons. NOTHING WORKS!

I tried singletons, findobjectoftype, tried doing some scene.magickery.

0

There are 0 best solutions below