I get this error Setting the parent of a transform which resides in a prefab is disabled to prevent data corruption. UnityEngine.Transform:set_parent(Transform) Spawner:Spawn() (at Assets/Scripts/Spawner.cs:77) Spawner:Start() (at Assets/Scripts/Spawner.cs:53)
[/Users/build/builds/unity-iphone-1.5/iphone-1.1/Projects/../Runtime/Graphics/Transform.cpp line 161]
when I do this code
line 77 is the second last line of code here. Also the parent is not changed. I know this code used to work because I could see the objects in the correct place in the hierarchy. I had to change prefab I was instantiating and now I get this error.
asked Feb 22 '10 at 01:32 PM
What's in monster1Holder and monster2Holder? are they transforms from gameobjects in your scene, or from prefabs?
Your problem could be that if they're prefabs, you're attempting to set your newly instantiated objects as children of these prefabs (which is probably just as invalid as setting parents of prefabs!).
answered Feb 22 '10 at 03:34 PM