How to instantiate and control 1 million toothpicks in realtime?
I want to place 1 million coloured toothpicks on XYZ coordinates from a CSV list and rotate each of them individually around their XYZ coordinate.
The individual toothpick rotation value should be calculated by the sine function of the sum of the individual X coordinate and a global sine step value updated each frame. Additionally, the calculation of global sine step value, as well as the rotation limits, should be interactive in realtime (rhythm, speed, limits)
When using a single toothpick as prefab and a c# script to instantiate 1million as separate game objects I soon face a gameobject limit.
Is there a way to place a prefab at 1 million XYZ coordinates and parametrically control all of them with one c# script?
If Unity prefabs are not an option is there any plugin, extension, way to instantiate and control a large number of objects parametrically?
Thank you very much for any help!!
Answer by Cuttlas-U · Apr 29, 2020 at 05:13 AM
hey ; u should use unity job system and burst compiler ;
there are lots of tutorials for it and it can handle any amount u need;
Answer by emanuelgollob · Apr 29, 2020 at 05:11 PM
thx Cuttlas! that´s exactly what I was searching for! :D
Your answer
Follow this Question
Related Questions
I get an error message every time i run this script? Any ideas? 0 Answers
Unable to set position of instantiated prefab 1 Answer
I need help destroying a clone on function. 1 Answer
Instantiated object retains variable values 0 Answers
My code is instantiating many prefabs, i only want one. 1 Answer