- Home /
Randomize Prefab on duplication
Hey, to make things easier on myself I want to implement a prefab randomizer. Basically each time you duplicate an object with the randomizer script attached, this duplicate should change to a random prefab from a list. This way I could list up multiple similar objects and by duplicating them a bunch of time get a great amount of complexity without changing every object myself.
The main thing I want to know is:
How do I detect duplication of an object.
How can I change the current object to the random prefab.
I tried copying all the components into the current object, but I think that could destroy batching, or be generally inefficient. Also I don't know if it would be efficient to assign the script to an empty gameobject and add the prefab to the objects hierarchy. This script should mainly be for working in the editor, it shouldn't affect the gameplay and the game at all.
I hope you can help me what the best approach to this would be.
Your answer
Follow this Question
Related Questions
randomly call prefab 1 Answer
Change angle of camera in prefab preview 4 Answers
Set Prefab position when added to scene (Edit mode) 1 Answer
How to spawn Prefab to a certain position. 2 Answers
Apply only a single value to prefab 1 Answer