How to clone a gameobject in runtime (not with instantiating)


I’m instantiating a game object and performing a boolean mesh operation on it (effectively making a hole in it) and saving it as a new game object (all in runtime).

How can I clone this new game object in runtime?


You can Instantiate() any game object to which you have a reference; it doesn’t need to be a prefab. It typically should be a prefab, but in your case, I suppose not. Consider keeping a hidden “original” version to clone from on which you’ll zero-out any transform changes so everything behaves nicely.

Is your boolean script super robust and performant? And did you make it yourself? Gimmie gimmie gimmie! :wink: