- Home /
Copy/Paste entire array in inspector?
Hi there,
I have a pretty complex script that finds the locations of all vertices in an object, then sorts them into a manageable array so that they can be easily manipulated later. The problem is that the only way I seem to be able to create this array is by putting the function in the Start() function. This also leads to a bit of a lag spike when these prefabs are instantiated. I could copy the values one by one and put them into the prefab, but there are hundreds of values.
Essentially what I want to do is run the script, copy the values while the game is running, then paste them into the prefab. Is this possible?
Thanks very much for your time!
Answer by Teravisor · Jan 31, 2016 at 10:02 PM
You can run game, right click on component name(near toggle button), click "Copy component" then turn game off, right click same component(or any of same type) and "Paste Component Values".
There's no easy way to copy arrays between different type of components; for that it's better to write editor script.
Thank you so much! I don't know why this never occurred to me. Have a great day :)
Your answer
![](https://koobas.hobune.stream/wayback/20220612062440im_/https://answers.unity.com/themes/thub/images/avi.jpg)