If I, for example, use this function with the parameters of
then "Game Object" will be renamed "Main Camera", but lose all of its components, including its Transform.
This can't be the intended use! So what is?
asked Dec 03 '09 at 09:13 PM
You need to use it on all components as well, but in my experience this results in crashing Unity. You can use it however to clone script settings to a new object. For example the script below copies the properties from JDiceSideUp script in object dice to (existing) object newDice (if script isn't there yet it will be added).
answered Dec 04 '09 at 01:09 AM
(First off, I apologize for not putting this in the comments, but UnityAnswers provides no functionality that I can see for a lengthy response, or one that includes code.) :-P
Thanks, but there is some kind of serious problem here. Using the simpler case from above, I believe the resulting script is this:
However, after doing that, it is impossible to remove the Camera component from the previously empty Game Object. This error also occurs:
answered Dec 11 '09 at 03:37 AM