|
If I, for example, use this function with the parameters of
and
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?
(comments are locked)
|
|
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). using UnityEngine;
(comments are locked)
|
|
(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:
Now what? As I said, CopySerialized seems to be buggy and crashes my environment often. It does work okay on scripts so you can use it to safely copy the script data. But other than that, I'd say CopySerialized is a bugreport worthy. As I'm plagued by so many bugs in Unity I've stopped reporting them, if project pressure drops I'll go and file a book full.
Dec 11 '09 at 05:56 AM
Jaap Kreijkamp
Well, that's good enough for me. You answered what it's "supposed" to do, even if it doesn't do a very good job. Thanks again.
Dec 11 '09 at 06:36 AM
Jessy
(comments are locked)
|
