|
Hi! i'm trying to get the component script from another scene that's currently calls it but it keeps returning NullReferenceException I'm trying to access the menuScript that is attached to the GuiNode Gameobject but as i said it belongs to a diffent scene from the one that calls it. Can you help?
(comments are locked)
|
|
You cannot access components in other scenes. The objects has to follow along with DontDestroyOnLoad() in that case. I will add on to this by saying: the reason you can't access gameobjects/components/scripts/etc. that only exist in other scenes is because the object/whatever is not even loaded in memory. From the engine's point of view, the thing doesn't even exist.
Jan 02 '12 at 04:53 PM
rabbitfang
(comments are locked)
|
|
Thank you for your answers! The reason why i want this, is because my first scene is used as a menu to choose between 1 player or 2 players in order to get a boolean value in the second scene about this choice.
(comments are locked)
|
