How can I find a disabled/inactive GameObject?
Hello everyone. I'll explain the problem that I'm having, hoping that someone will be able to help me figuring out what I should do:
I'm creating a metroidvania, and each group of rooms( from 5 to 10 rooms) is in a different scene, for I want to be able to make it modular(maybe having some repeated corridors with some specific different enemies or objects on it, by using another scene loaded additively) . About the player, I want him to persist during the loading of the new scene. I'm doing so by diactivating the Player at the boundaries(doors) to the new scene.
The problem that I'm having is: When my player goes to the new scene, I want to be able to set the player active again.( I need this because in the loading scene, that takes about 1 to 2 second, the player needs to keep its position and all its data). However, Gameobject.SetActive(true)
just works with inactive gameobjects, if there is a reference to it throught the IDE/inspector.
What should I do to make it active on this new scene? Is there a way to GameObject.Find
with inactive/disabled gameobjects?
Your answer
Follow this Question
Related Questions
LoadScene not working 0 Answers
PlayerPrefs not resetting after death 1 Answer
Why doesn't this script work? 1 Answer