Is This the Correct Way to Duplicate Scene Objects?
Was curious if this was the proper way to duplicate an existing scene object?
It sort of works in that I see Scripts get called and Meshes get rendered. However, for Meshes, they dont seem to cast Shadows anymore. For Components, in general when I try to call getComponentCount on the duplicate it returns 0 but on the original it returns the correct number 2 (i just had a script and mesh visual) and I am unable to get a reference to them via getComponentByIndex

Hi Fuseman,
copyWholeHierarchy() will create a copy of the target object as a new child of the current object. So in your script, nextCopy will actually be a parent object to the new copy of sceneObject.
If it's ok for the copied object to have a parent, you can change the last line of your script to:
which should now return the copy, instead of the parent of the copy.
Sorry for the confusion, hope this helps! Let me know if you have any more questions.
I see! Yup that did the trick for me. Would definitely be a good thing to add that to the docs but glad it's an easy fix :)