References of a Prefab
I've made an Enemy Prefab with some public values. It needs a Player and a Text to show the Infos of it (like Health, Name etc..). Whenever I put the Prefab into the game scene or I instantiate it using a C# code, it has no references and I can't change them in the Inspector. How should I reference things in it? (Sorry for my bad English)
Answer by jdean300 · May 03, 2017 at 04:34 PM
References to other objects will not be saved with the prefab. You need to use things like GameObject.FindGameObjectsWithTag
to find references to the other objects in the scene.
Your answer
![](https://koobas.hobune.stream/wayback/20220612121213im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Create gameobject in other scene... 0 Answers
prefab/instantiate problem. C#,Instanciate/Prefab problem. 0 Answers
Prefabs not instantiating after build 0 Answers
Changing rotation of prefab 0 Answers