How can I duplicate a gameObject, its mesh, but *none* of its components?
I want to clone an object's renderers (all the renderers on its children) and nothing else.
Here's the thing: Some of these objects have a bunch of different scripts, some very hefty (the OnAwake or OnStart function will pause the game for several seconds while a bunch of complex equations are run). I don't want to copy any of these scripts, I don't want them to run on the clone Objects (it'll crash everything).
Past attempts have included:
Looping through an array of monobehaviours on the clone and disabling them
Looping through an array of components on the clone and destroying them (using destroy immediate seems to crash unity every once in a while, so this is not a preferred method)
I haven't seen a good example of someone looping through a gameobject and duplicating its mesh component, so I'm not entirely sure how that can be accomplished.
If only there was some option to only clone certain components, so these scripts don't run and crash everything...
Your answer
Follow this Question
Related Questions
Access CanvasRenderer render buffer? 0 Answers
Model not rendering//no textures. 0 Answers
Octane Renderer 0 Answers
PBR View Port Scale - Octane Renderer 0 Answers
Unity 2020 URP fog of war 0 Answers