Ok I’m making a FPS and I’m trying to make a script that will allow the player to pick up weapons off the floor. I do this by instantiating the weapon in front of the player and parenting the weapon to the player. Every thing work’s fine but when I made the weapon a prefab it didn’t work and an error message came up and it said something like “parenting a prefab is disabled to prevent data corruption”. So my solution is to break the connection of the prefab in the awake function? But I don’t know how to stop the prefab connection. Anything will help thanks!
http://forum.unity3d.com/threads/86417-Nested-Prefabs
also i think built in nested prefabs will come with unity 3.5.
3.5 does not have nested prefabs that work the way you would expect. Sadly. But apparently they did work aimed in that direction. So maybe the next big release?
Speaking of 3.5, in that version you can use this:
static function DisconnectPrefabInstance (targetObject : Object) : void