Issue in InstancedMesh clone

Hello, I found a stack overflow when trying to clone an instance and assigning the instance as the parent of its clone (via the clone method).
Here’s a playground :

Thanks in advance for the fix.

You cannot assign ‘self’ as parent of your ‘self’! you don’t have children, do you? :grin: :face_with_hand_over_mouth: ‘Self’ IS its own parent (unless parented to new). And then, I don’t really see why you want to ‘clone’ an instance as such. Why not just make two instances? Unless you clone the hierarchy. Cloning an instance will still remain an ‘instance’ (of the source). You won’t be able to change IE its material as you would do with a clone (from a mesh).

You cannot assign ‘self’ as parent of your ‘self’!

Indeed, what I meant was assigning the original instance as the clone parent. I’ll edit the post.

And then, I don’t really see why you want to ‘clone’ an instance as such

Yeah it’s a very specific case, though the code i’m working on probably wont be definitive. But I found the issue and I think one less stack overflow is always a good thing :slight_smile:

1 Like

Can’t agree more :+1:. It has become the last place where I go :dizzy_face: Each time I go there it gets me even more confused :face_with_hand_over_mouth: :grin:. It’s named ‘overflow’ anyway… so what can you expect? :rofl: I’m glad you found your solution. Have a great day :sunglasses:

1 Like