x


Which GO is the new one when i Duplicate a GO

When i Duplicate a GO it makes a copy with exactly the same name.. if i have references to that original object in my project and then edit the wrong one i mess things up.

Why does it not make a new name with _copy or something? How can i tell what is the new one?

Q

more ▼

asked May 30 '12 at 04:05 AM

qholmes gravatar image

qholmes
115 6 6 14

This seems like a good question. I hadn't noticed that before and tried it and it is just as you said.

May 30 '12 at 04:11 AM kolban

Yes it drives me nuts.. I am in a jam right now i was experimenting with code and i used the wrong one and am now chasing references all around my project..

May 30 '12 at 04:18 AM qholmes
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

When you duplicate an object, the one that's currently selected immediately after duplication is the new one. This is reasonably standard behavior, but the lack of any name differentiation can indeed be confusing.

Note that you can make your own duplicate command with different behavior...here's a quick & dirty Dupe command script, that duplicates a GameObject and adds "copy" to the end:

@MenuItem ("Edit/Dupe %#d")
static function Dupe () {
    var go = Selection.activeObject as GameObject;
    var dupeGo = Instantiate(go);
    dupeGo.name = go.name + " copy";
}

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

Feel free to improve it, such as adding undo, and making multiple copies be appended with "copy 2", "copy 3", etc.

more ▼

answered May 30 '12 at 04:35 AM

Eric5h5 gravatar image

Eric5h5
80.1k 41 132 519

ya especially when you clone numerous times.

May 30 '12 at 04:49 AM flamy

Hey now i call that an answer and a solution!!!

Thanks a lot!

Now i just have to figure out what to do with this script.

Why is the Manual not searchable?

Q

May 30 '12 at 02:44 PM qholmes

It is, use Google with site:unity3d.com. Anyway all you have to do is put the script in a folder called Editor.

May 30 '12 at 02:52 PM Eric5h5

I get a parsing error 1,11 for this script?

Q

May 30 '12 at 04:06 PM qholmes

Not sure what you mean, the script doesn't have any errors.

May 30 '12 at 04:18 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x61
x52

asked: May 30 '12 at 04:05 AM

Seen: 296 times

Last Updated: May 30 '12 at 08:50 PM