- Home /
Question by
roroquessada · Oct 16, 2020 at 01:52 PM ·
gameobjectinstantiatecomponentframework
Instantiate(Component) make a new GameObject?
Hi,
I would to know if the Instantiate command with Component creates a new GameObject with the new Component or creates an other Component in the same parent GameObject?
For example:
LineRenderer old = new GameObject().AddComponent<LineRenderer>();
LineRenderer line = Instantiate(old);
line is in the old's GameObject or is in a new GameObject?
Thanks
Comment
Best Answer
Answer by IggyZuk · Oct 16, 2020 at 02:03 PM
It's going to make a new game object with a new LineRenderer component that has the same values.
Your answer
![](https://koobas.hobune.stream/wayback/20220613012617im_/https://answers.unity.com/themes/thub/images/avi.jpg)