Playmaker Forum

PlayMaker News => General Discussion => Topic started by: qholmes on May 29, 2012, 08:26:16 PM

Title: [SOLVED]Duplicate GO
Post by: qholmes on May 29, 2012, 08:26:16 PM
Ok this may be a dumb question but when i Duplicate an object how do i know what is the new one and what is the old one.. when you have an object referenced around your project and then duplicate it and manipulate it and then realize you were manipulating the wrong one you end up where i am right now... again...

Why does it not give it a new name with copy on it or something.

Title: Re: Duplicate GO
Post by: qholmes on June 01, 2012, 11:49:37 AM
I got a good answer on this from the Unity Answers along with a script to make my own Duplicate command. I had to adjust it some but love it now..

Title: Re: Duplicate GO
Post by: jeanfabre on June 04, 2012, 03:49:12 AM

 could you share the link to the answer? cheers,


Title: Re: [SOLVED]Duplicate GO
Post by: qholmes on June 04, 2012, 07:46:59 AM
Sure just trying to find the post.. I can not log into Unity Answers for some reason and i have not received any replies to my help requests. I have to use the I Forgot my Password Link every time..

There is the link.. And here is the script i ended up making.. It is just a hack i am sure but it sure works for me.. I realized that it does not work for other things besides GO but other things already index the names. Like materials.

Its Java... As you will see in my post i did not get that right away.. ???

Code: [Select]
@MenuItem ("Edit/Dupe %#d")
static function Dupe () {
    var go = Selection.activeObject as GameObject;
    var dupeGo = Instantiate(go); = + " copy";
dupeGo.transform.parent = go.transform.parent;
dupeGo.transform.position = go.transform.position;
dupeGo.transform.rotation = go.transform.rotation;


@MenuItem ("Edit/Dupe %#d", true)
static function Validate () {
    return Selection.activeObject != null;