- Home /
Losing GUIText Reference in Prefab
Good evening,
I am a beginner unity user working on a basic application. I have a user controller object (A boat) going around and colliding with various objects, and when they collide it increments an object count on the GUI.
On the objects that I collide with, they are set to destroy and increment the GUIText on trigger collision. However the prefab will not hold a reference to the GUIText. If I drag an instance of the prefab onto the map, I can reference the GUIText. But on prefabs it does not remember the name of object for the public GUIText, and will not allow me to drag the GUIText object onto the field to connect. But it will allow me to do so on an instance of the object.
The objects are instantiated through code, so as instances they are not referring to GUIText. Is there a convention I am doing wrong here?
thanks
Prefabs cannot reference scene objects as that wouldn't make any logistical sense. The scene object doesn't exist if the scene isn't loaded, so how could a prefab reference it then?
Your answer
Follow this Question
Related Questions
Creating GUITexture with a reference 1 Answer
Can't drag object references!! 1 Answer
GUI Button Animation Cue 1 Answer
Object reference not set... but... it is? 0 Answers
timer problem 1 Answer