- Home /
Question by
REM_Studios · Sep 22, 2019 at 08:40 PM ·
gameobjectinstantiateprefabreference
Reference Player When Instantiating A Prefab
I am trying to instantiate objects (police cars) from a prefab and have them chase the player car. I am using the Unity AI Skycar with my own car body. When I try to instantiate the prefab, it loses the connection to the follow the player. Apparently I need to reference my player to my police prefab before it is instantiated, but I am not sure how to do so. If somebody could explain to me how this works, this will help in my further knowledge.
Thank You, R.E.M. Studios
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612212507im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
gameObject are not referenced 2 Answers
Add 0.5f to Vector.Right on next instantiated object ? 1 Answer
Instantiated Object being auto-deleted 0 Answers
How to instantiate within GameObject 1 Answer
Unity not Instantiating as Prefab 1 Answer