|
I have a bunch of objects that I've populated my levels with, objects that are children of prefabs, and now have made alternate (similar but different in attributes such as shader color) prefabs that I'd like to replace selected placed objects with. So... is there a way to change the prefab an object is a child of while still maintaining that objects local information like name and position?
(comments are locked)
|
|
If you want to change the prefab of a game object in a scene, you can simply drag the new prefab over the old object while holding the ALT key (that's on Mac - but I guess it would also be ALT on Windows). This will keep the name and position of the object - but replace the "contents" of the objects. This way, you could easily apply prefabs to placeholder objects - or change the prefab if you have multiple ones. EDIT: When I say "drag the new prefab over the old object" I mean "drag the new prefab over the old object in the hierarchy pane". It seems that this doesn't work when dragging the objects over the scene view (which I, admittedly never even tried ;-) ). Interesting. Drag over the object in the scene and it works. Not using alt gives the object the properties of the prefab without making it a prefab. One problem is that the objects always move after re-associating the prefab. Anyway around that?
Jul 18 at 09:54 PM
Goody
Actually, when I use alt+drag, the objects don't move for me. When I don't use ALT, I instead create a new instance of the prefab (which would break the original prefab connection).
Jul 19 at 08:17 AM
Jashan
I take it back, I was making new ones instead of changing old ones. :) Frustratingly, none of the standard key drag combinations (alt/shift/mac special button) do anything, dragged either on top of the object in the scene view or in the hierarchy. I have the free version of Unity. Do you have the paid?
Jul 19 at 11:51 PM
Goody
I own Unity Pro but that sure doesn't make a difference in that area. Also, I'm using Unity 3 beta ... which may make more of a difference. Let me recheck with Unity 2.6.1 ... does work; with the ALT-key. For some odd reason it didn't work for me "in the beginning" but then, after trying all different keys, it did work. What I do: Create 2 Prefabs, and 3 instances of those prefabs in a scene. Then, I ALT+drag/drop one prefab on all 3 instances. Works perfectly. Then, I ALT+drag/drop the other prefab on all 3 instances, again works like a charm. This is on Unity 2.6.1 (and with a real Mac kbd)
Jul 20 at 01:22 PM
Jashan
Huh, sure don't work for me. I have 2.6.1 and a Mac Mini running osx 10.5.8. Tried unity iphone ver. 1.7 and it didn't work either. Suxs! With 2.6.1 the new unwanted objects created by this method all seem to be placed at about -6000 on the Y. With 1.7 they are around -400. My scene is a "top down" game with the cam rotated 90 on the X and the objects laying flat under it. I think I'm going to submit a bug for this. Thanks for your help!
Jul 20 at 09:23 PM
Goody
(comments are locked)
|
Unity Answers has moved to a new system, and some users may have trouble logging in.