❔ Access things from different scene in Unity
I have a Class Selector scene that has a Class Selector Script component (MonoBehaviour) attached to one of it's GameObjects, see first screenshot.
I have a Stat Selector scene that has a Stat Selector Script component (MonoBehaviour) attached to one of it's GameObjects.
The Stat selector holds a field of type ClassSelector and I want to assign to it the ClassSelector from my ClassSelector Scene, how can I do that?
8 Replies
the
GetRootGameObjects()
throws ArgumentException: "The scene is invalid"
I was hoping I could search through that for the GameObject and the Class Selector Script component attached to that GameObject
Debug.Log(classSelection.rootCount)
prints 0 for some reason, I dont understand why.You have to load it, then wait a frame or two, then query the objects. If you're doing it in the editor, use a prefab instead and reference it in both places
but if I load the scene then I have two scenes loaded and displayed 🤔
You're doing it the wrong way
either you want a scriptableobject or just save it to json
also why you make a separate scene just for the stats?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.its a StatSelector scene. The User can assign different randomly generated values to different character stats such as intelligence, strength...
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.